Witch
# foo.rb
require 'witch'
Witch.init(:queue => 'events')
Witch.once 'hello', do |name|
Witch.publish('message', "Well hello there #{name}")
end
Witch.on 'message', do |msg|
puts "Got message: #{msg}"
end
Witch.publish('hello', 'foo')
# bar.rb
require 'witch'
Witch.init(:queue => 'events')
Witch.once 'hello', do |name|
Witch.publish('message', "Well hello there #{name}")
end
Witch.on 'message', do |msg|
puts "Got message: #{msg}"
end
Witch.publish('hello', 'bar')
Contributions
You're more than welcome. Send a pull request, including tests, and make sure you don't break anything. That's it.
Copyright
(c) Fork Limited. MIT license.