     (fileRotated [this]
       (println "Rotation detected"))
     (^void handle [this ^String line]
-     (println "Processing:" line)
      (a/>!! c line))
     (^void handle [this ^Exception i]
      (println (str "exception: " i)))))

   (when-let [v (a/<!! c)]
     (cons v (chan->seq c)))))

(defn tailer-listener [c]
  (reify TailerListener
    (init [this tailer] ())

    {:channel c
     :tailer  tailer}))

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

(fact (let [lines     ["a" "b" "c" "d" "e"]
            file      (File. "test/_work-dir/plop.log")
            t-and-c   (tailer-and-channel file 100)
            result-ch (a/thread (doall (tailer-and-channel->seq t-and-c)))]
        (Thread/sleep 1000)
        (spit file "")
        (spit file (str (str/join "\n" lines)
                        "\n"))
        (Thread/sleep 1000)
        (println "Stopping")
        (stop-tailer-and-channel t-and-c)
        (a/<!! result-ch)
        => lines))

;; TODO
;; Check that bug.
