Feedback request: basic pub/sub event bus for tokio

Hey folks -- I wrote a small and simple pub/sub event bus on top of tokio's broadcast channels. I've published it here: GitHub - dannygale/tokio-pubsub: A simple publish/subscribe event bus built on tokio's broadcast channels for the moment. Crates.io eventually

I've been poking around in rust and playing with tokio for some time but this is really the first thing I've put out into the world. I'd really like to hear:

  • whether you think this is valuable (it's quite helpful for something else I'm working on)
  • feedback on the implementation and design choices
  • ideas for improvements and extensions. I have some already, see below
  • And any other feedback you might have!

My ideas for improvements and extensions:

  • digging through the source of tokio::sync::broadcast it seems feasible to reimplement this as a "smarter" type of channel, rather than the way it is currently.
  • implement publish channels as "transparent" so that the topic doesn't need to be specified with each publish
  • in-band modification of subscriptions
  • subscribe to multiple topics on one receiver channel
  • observability of bus events
  • subscriber-specific rule-based event filtering
  • subscriber- or topic- or rule-based event transformations
  • adapters for REST APIs, etc
  • make PubSub Sync

I am aware of a few other attempts at similar but haven't really dug into them in detail:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.