Skip to content

Instantly share code, notes, and snippets.

/t.rb

Created July 20, 2012 08:00
Show Gist options
  • Save anonymous/3149458 to your computer and use it in GitHub Desktop.
Save anonymous/3149458 to your computer and use it in GitHub Desktop.
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