Fork me on GitHub

I’m using a pipeline-blocking and keeping the to channel around for later reference. At a certain point (when I detect an error), I want to close! the to channel, which, according to the documentation (as far as I can read) should stop consumption from the from channel. However, my xf, which processes the from output and puts it on the to, does some printing as a side effect, and I can see that it is printing for all of the entries from from even after I call (close! to). Am I misunderstanding something?


looks like nobody’s responded — I’ve held off because I don’t know the answer and have not had time to dig in myself. however, I can say when it comes to these sorts of details with core.async I’ve just studied the source. Generally it’s not a bug but a subtle characteristic of the tool.


my bet is there’s an internal channel between from and to which has the transducer


and pipelines are designed to use feedback from the from channel’s open/closed status to update its internal state, not the to channel’s status


so in summary — I don’t think the docs guarantee that closing the to channel immediately halts execution & processing of messages from the from channel


if that’s what you need you may want to design something for your specific use case


either instead of pipeline or by composing pipeline with other communicating proccesses


a promise chan for flagging an error state consumed by an explicit non-blocking take (prioritized alts or poll) immediately before the side-effecting code comes to mind first


(To be clear; I am not calling pipeline-blocking with a close? argument, rather, I am calling (close! to) manually.)