Create a gist now

Instantly share code, notes, and snippets.

anonymous /noisy.rb
Created Dec 18, 2012

What would you like to do?
require 'pp'
require 'rufus-json/automatic'
require 'ruote'
ruote = Ruote::Dashboard.new(Ruote::Worker.new(Ruote::HashStorage.new))
ruote.noisy = ENV['NOISY'] == 'true'
ruote.register do
alpha Ruote::StorageParticipant
end
pdef =
Ruote.define do
concurrence :count => 1 do
cursor :tag => 'C1' do
alpha :timeout => '10s'
end
cursor :tag => 'C2', :lose => true do
wait '2s' # simulating 'bravo' replying before alpha
jump :to => 'alpha', :ref => 'C1'
end
end
end
wfid = ruote.launch(pdef)
ruote.wait_for(wfid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment