The docs for pipeline say "Will stop consuming the from channel if the to channel closes." however currently the go block that is reading results and putting to the to channel does a >!, and checks the return value to stop trying to output the current output value, but then goes ahead and tries to process the next output anyways. Thus, if the to channel is closed, the pipeline will continue reading, processing, and attempting to spit values at the to channel without stop.
Also, even if it did stop, some number of values will already have been read from the from channel (1 may be in-process in the output go block, N may be in the results channel, and N may be parked in flight in process go blocks).
(require '[clojure.core.async :as a])
(let [from (a/to-chan (range 100))
to (a/chan 1)]
(a/pipeline 1 to (map #(doto % println)) from)
(a/close! to))
;; prints 0...99
;; Expect: should print no more than 4 items (1 in to, 1 in out go, 1 in results chan, 1 in process go)
*Proposed:* One option would be to change the doc string and not promise this behavior. Another would be to cause the close to flow back through the pipeline structure, shutting it all down.