Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Test on the :union option for concurrent participant.
#!/usr/bin/env ruby
require 'pp'
require 'ruote'
engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::HashStorage.new()))
#engine.noisy = true
engine.register_participant :alpha do |workitem|
workitem.fields['choses'] = { 'truc' => 'bidule', 'machin' => 'chose'}
end
engine.register_participant :beta do |workitem|
workitem.fields['choses'] = { 'curt' => 'eludib', 'nicham' => 'esoch'}
end
engine.register_participant :delta do |workitem|
pp workitem
end
proc = Ruote.process_definition do |workitem|
sequence do
concurrence :merge_type => :union do
participant :beta
participant :alpha
end
participant :delta
end
end
id = engine.launch(proc)
engine.wait_for(id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.