Fork me on GitHub
#core-async
<
2016-09-13
>
borkdude09:09:54

Why is there mult and can’t you tap on a channel directly?

wagjo21:09:32

mult manages the process of copying of messages from one input channel to ones that 'tap' onto the mult object. Moreover, user can tap/`untap` channels at any time. Having this functionality separate from a channel saves you a lot of headaches, e.g. what the channel should do it there are channels tapped and somebody else calls take! on that channel. By returning the mult object instead, you are restricting what the receiving party can do with it. Moreover, mult has a very specific requirements on channels that may not be suitable for all cases.