core-async

2020-10-20T10:58:57.076300Z

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

2020-10-20T10:59:57.077500Z

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

cgrand 2020-10-20T12:20:20.080Z

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 K 2020-10-20T13:52:20.082700Z

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 K 2020-10-20T14:04:28.083900Z

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).

alexmiller 2020-10-20T14:06:41.084400Z

sorry, I have not fully read everything above. if there is a bug, please file a question at https://ask.clojure.org

alexmiller 2020-10-20T14:08:55.085300Z

oh, thanks :)

alexmiller 2020-10-20T14:24:11.085900Z

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

❤️ 1