Fork me on GitHub
#core-async
<
2020-10-20
>
otfrom10:10:57

Interesting issue with stateful transducers and core.async here: https://github.com/cgrand/xforms/issues/37

otfrom10:10:57

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

cgrand12:10:20

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. https://clojure.org/reference/transducers

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 https://ask.clojure.org

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