Skip to content

Instantly share code, notes, and snippets.

/t.rb

Created May 30, 2012 02:26
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/2833014 to your computer and use it in GitHub Desktop.
Save anonymous/2833014 to your computer and use it in GitHub Desktop.
require 'ruote'
$dboard = Ruote::Dashboard.new(Ruote::Worker.new(Ruote::HashStorage.new))
$dboard.noisy = true
class Observer
def on_msg(msg)
return unless msg['action'] == 'terminated'
p msg
end
end
$dboard.add_service('observer', Observer)
pdef = Ruote.define do
alpha
bravo
end
class MyParticipant
include Ruote::LocalParticipant
def on_workitem
puts "+++ #{workitem.participant_name} +++"
reply
end
end
$dboard.register do
catchall MyParticipant
end
wfid = $dboard.launch(pdef)
$dboard.wait_for(wfid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment