Fork me on GitHub

Interesting issue with stateful transducers and core.async here:


but I suppose the question is "where is the right place to handle it?"


Another way to frame the question: are transducing contexts allowed to call the completing arity more than once? If yes it means that all “flushing” (that do stuff on completion) transducers must defend against extra calls.

Jan K13:10:20

The docs are quite explicit: A completing process must call the completion operation on the final accumulated value exactly once.

Jan K14:10:28

Seems like a core.async bug to me. But at least it works if you use promise-chan when you're only expecting one result (by works I mean calls the completion only once, repeating/infinite output from the channel is then as expected from promise-chan).

Alex Miller (Clojure team)14:10:41

sorry, I have not fully read everything above. if there is a bug, please file a question at

Alex Miller (Clojure team)14:10:11

I must have missed this when originally posted, I'll take a look at it when I have time

❤️ 3