Fork me on GitHub
#core-async
<
2017-08-17
>
timgilbert19:08:38

Say, is there a variation on the core.async pub/sub stuff where my subscribers can provide a predicate that takes the topic as input and returns true if it should be handled?

timgilbert19:08:48

As far as I can tell the setup as-is can only dispatch on (= event-topic subscriber-topic), but I'd like it to dispatch on (my-predicate event-topic) instead. One motivation for this is I want to write a fire-hose function that receives every event regardless of the topic.

noisesmith19:08:20

@timgilbert wouldn’t it be simpler to have a mult coming off the same channel that goes into the pub?

noisesmith19:08:46

so the pub and the mult get all the same messages, subscribing to the mult gets all messages, subscribing to the pub gets the topics you subscribe?

noisesmith19:08:34

and I could even imagine a system where you expand on this by tracking the set of existing topics from the mult

timgilbert20:08:17

Yeah, was just thinking about doing that