Skip to content

Instantly share code, notes, and snippets.

/t.rb

Created May 30, 2012
Embed
What would you like to do?
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
You can’t perform that action at this time.