                         (io/make-parents f)
                         (spit f "this will be ignored this will be ignored this will be ignored this will be ignored\n")
                         f)               
-            t-and-c   (tailer-and-channel file delay-ms)
+            t-and-c   (make-tailer-and-channel file delay-ms)
             result-ch (a/thread (doall (tailer-and-channel->seq t-and-c)))]
         (spit-lines-s file lines-s sleep-ms)
         (stop-tailer-and-channel t-and-c)

            (str line "\n")
            :append true)
      (Thread/sleep sleep-ms))))

(fact (let [delay-ms  100
            sleep-ms  (+ delay-ms 10)

    (^void handle [this ^Exception i]
     (println (str "exception: " i)))))

(defn make-tailer-and-channel [file delay-ms]
  (let [c      (a/chan)
        tailer (Tailer/create file
                              (tailer-listener c)
                              delay-ms
                              true)]
    {::channel c
     ::tailer  tailer}))

(defn channel [t-and-c]
  (::channel t-and-c))

(defn stop-tailer-and-channel [{:keys [::channel ::tailer]}]
  (.stop tailer)
  (a/close! channel))

