Fork me on GitHub

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:


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


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


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.