Publishing my second Ruby gem here with the community, introducing Rocketman
!
Description
Rocketman is a gem that introduces Pub-Sub mechanism within Ruby code.
As with all Pub-Sub mechanism, this greatly decouples your upstream producer and downstream consumer, allowing for scalability, and easier refactor when you decide to move Pub-Sub to a separate service.
Rocketman also works without Rails.
Rocketman
yes, I know it says Starman on the image
🎶 And I think it's gonna be a long long time 'Till touch down brings me round again to find 🎶
Rocketman is a gem that introduces Pub-Sub mechanism within your Ruby code.
The main goal of Rocketman is not to replace proper message buses like Redis PubSub/Kafka, but rather be a stepping stone. You can read more about the rationale behind the project down below.
As with all Pub-Sub mechanism, this greatly decouples your upstream producer and downstream consumer, allowing for scalability, and easier refactor when you decide to move Pub-Sub to a separate service.
Rocketman also works without Rails.
Installation
Add this line to your application's Gemfile:
gem 'rocketman'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rocketman
Usage
Rocketman exposes two module, Rocketman::Producer
and Rocketman::Consumer
. They do exactly as what their…
Usage
emitting events look as easy as this:
emit :hello, payload: {"one" => 1, "two" => 2}
and listening for events look like this:
on_event :hello do |payload|
puts payload
end
There’s more information on the Usage
section and Roadmap
if you’re interested in the project, otherwise, feel free to comment here too!
Top comments (0)