Skip to content

Instantly share code, notes, and snippets.

Created December 18, 2012 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4332547 to your computer and use it in GitHub Desktop.
Save anonymous/4332547 to your computer and use it in GitHub Desktop.
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