Skip to content

Instantly share code, notes, and snippets.

Created November 2, 2012 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4004660 to your computer and use it in GitHub Desktop.
Save anonymous/4004660 to your computer and use it in GitHub Desktop.
require 'rufus-json/automatic'
require 'ruote'
require 'ruote-amqp'
$em = Thread.new { EM.run {} }
sleep 0.5
$dboard = Ruote::Dashboard.new(Ruote::Worker.new(Ruote::HashStorage.new))
$dboard.noisy = ENV['NOISY'] == 'true'
$dboard.register(
:toto,
Ruote::Amqp::Participant,
:exchange => [ 'direct', '' ],
:routing_key => 'kindjal-test-1')
class KindjalReceiver < Ruote::Amqp::Receiver
def handle(header, payload)
puts "-" * 80
p header.class
p payload.class
end
end
$receiver = KindjalReceiver.new(
$dboard, AMQP::Channel.new.queue('kindjal-test-1'))
pdef = Ruote.define do
toto
end
$dboard.launch(pdef)
#$dboard.wait_for('terminated')
sleep 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment