-
-
Save anonymous/2833014 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 '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