                                       batch-size
                                       interval-ms
                                       sleep-ms)]
-    (.start (Thread. #(dequeue bodies-ch output-fn)))))
+    (dequeue bodies-ch output-fn)))

  [bodies-ch output-fn]
  ;; We do loop-recur instead of while
  ;; because maybe the channel will be closed.
  (loop []
    (let [[body c] (alts!! [bodies-ch])]
      (if (nil? body)
        (println "Plumbing thread exiting.")
        (do
          (output-fn body)
          (recur))))))

(ns fowles.plumbing
  (:require [clojure.core.async :refer [go-loop alts! chan]]
            [fowles
             [requester :as requester]
             [gatherer :as gatherer]]))
