Skip to content

Instantly share code, notes, and snippets.

@jmettraux

jmettraux/t4.rb Secret

Created July 20, 2013 10:33
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 jmettraux/fcd2a731e0c66af64e3f to your computer and use it in GitHub Desktop.
Save jmettraux/fcd2a731e0c66af64e3f to your computer and use it in GitHub Desktop.
Ruote.define do
set 'f:participants' => [ "a", "b", "c" ]
citerator :on => "$f:participants", :to_var => 'v', :merge_type => 'concat' do
#
# first pass, each participant registers its slot
#
participant '$v:v', :task => 'register_slot'
end
# at this point, thanks to merge_type "concat" the single workitem
# holds all the registered slot information
citerator :on => "$f:participants", :to_var => 'v' do
#
# second pass, each participant sees its slot and all the other
# attributed slots
#
participant '$v:v', :task => 'do_the_job'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment