Created
June 25, 2010 06:21
-
-
Save lbt/452509 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class EngineParticipant | |
include Ruote::LocalParticipant | |
def initialize (opts) | |
@opts = opts | |
end | |
def consume (wi) | |
if wi.fields.has_key? 'command' | |
case wi.lookup "command" | |
when "register" | |
puts "Registering:" | |
$engine.register_participant(wi.lookup("name"), RuoteAMQP::Participant, wi.lookup("options")) | |
end | |
end | |
reply_to_engine(workitem) | |
end | |
end | |
$engine.register_participant 'engine_command', EngineParticipant |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment