Fork me on GitHub
#core-async
<
2016-12-08
>
terje02:12:02

pub also silently drops messages received when there are no matching subs for a topic, including before there are any subs at all. So messages may get lost without notice if a publication is created for a channel that contains or receives incoming messages before subscriptions are completed. I have revived a JIRA issue that addresses this concern: http://dev.clojure.org/jira/browse/ASYNC-46

raymcdermott12:12:31

@terje you might be right. The caller - making the mult - may have been slightly slower than the process which was reacting to the event and publishing on to the channel. In any case, there was a race condition now you make me think about like that.

raymcdermott17:12:12

You’ve already helped with the main problem @terje so I don’t have the race condition. Would just be nice to know what I’m doing wrong (if anything).

terje23:12:18

To avoid dropping messages, the channel passed to mult should not receive messages until the tap is completed. One way to achieve that is using pipe at the end to connect the events-ch with a separate channel provided to mult.