-
-
Save anonymous/3149458 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.register_participant 'toto' do |workitem| | |
p [ :pa, workitem.participant_name, workitem.wfid ] | |
end | |
class Listener | |
def initialize(context, opts={}) | |
end | |
def on_msg(msg) | |
p [ msg['action'], msg['wfid'] ] if msg['action'] == 'terminated' | |
end | |
end | |
dboard.add_service('listener', Listener) | |
3.times do | |
dboard.launch(Ruote.define do | |
toto | |
end) | |
end | |
sleep 5 # give it some time to execute the flows before exiting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment