I have a process that subscribes to multiple topics on a pubsub and I want the pubsub to send messages like {topic, message} instead of just message so I can tell what topic I’m receiving information from. How can I accomplish this without slowing anything down? A custom dispatcher? An option I missed somewhere?
I guess including it in the message is the fastest possibliity.
Seems like the topic is basically designed not to propagate from the pubsub
The dispatcher must be available on all nodes running the PubSub system. The dispatch/3 function of the given module will be invoked with the subscriptions entries, the broadcaster identifier (either a pid or :none), and the message to broadcast.
– pubsub documentation
so topic isn’t even given to the dispatcher, it’s really gone. i have to include this information in the message it seems.