Skip to content

Instantly share code, notes, and snippets.

@lbt
Created June 25, 2010 06:21
Show Gist options
  • Save lbt/452509 to your computer and use it in GitHub Desktop.
Save lbt/452509 to your computer and use it in GitHub Desktop.
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