Clark Event Bus
- Shared between bank_api and bank_events, so they trigger and listen to events that may occurr on Clark Bank Applications.
Installation
Add this line to your application's Gemfile:
gem 'clark_event_bus'
Usage
Emitter
emitter = Clark::EventBus::Emitter.new(options)
routing_key = 'user.registered'
payload = {email: 'foo@mail.com'}.to_json
emitter.trigger(payload, routing_key)
Listener
listener = Clark::EventBus::Listener.new(options)
listener.on("user.registered") do |event|
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Badges
GitHub @rafaeljesus · Twitter @rafaeljesus