Created
November 2, 2012 22:09
-
-
Save anonymous/4004660 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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