core-async

Jakub HolĂ˝ 2021-04-16T07:44:29.125200Z

A while back, with the kind help of this channel, I have created catching-transduce , which is similar to transduce but checks for Throwable in the input channel and catches exceptions during the transformation / reduction step and returns the exception if any. Feedback welcome. https://gist.github.com/holyjak/61d89610e488f31d8c53b8bbbad299c1 I have to admit it was a real struggle to make sure that it never hangs....

Milan Munzar 2021-04-16T19:37:01.130900Z

I find that it is a bit of unfortunate that as/pipe returns it's to channel. Would be nice if it had the same semantics like pipeline function which allows it to be awaited for when the pipeline is done.

Jan K 2021-04-16T19:44:11.131Z

I agree, luckily it's easy to define your own pipe by copying the original https://github.com/clojure/core.async/blob/v0.2.395/src/main/clojure/clojure/core/async.clj#L460

Milan Munzar 2021-04-16T19:58:31.131200Z

even better you can do:

(as/pipeline 1 o-chan (map identity) i-chan)

2021-04-16T20:56:02.131400Z

Personally I use pipe more often for ongoing processes and do take advantage of the fact that it returns a channel somewhat frequently