Fork me on GitHub

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?


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.


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


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?


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


Yeah, was just thinking about doing that