Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
Add Comment
Please, Sign In to add comment