On Sat, Feb 20, 2010 at 6:12 AM, Dave @ UPENN <[email protected]> wrote: > > Thanks this is exactly what i was looking for. Using > concurrent_iterator and 'isolate', I should be able to complete what > I'm working on. Things do get a little interesting when using more > than one concurrent block in the process definition. Not sure I > understand what logic the indexing for workitems follow in that case, > but I probably won't need anything that complex anyways.
Hello Dave, I'm using integers turned into strings for the indexing since the convention for workitem fields is that fields is a dictionary/hash (and must be JSONifiable http://json.org/ (keys for objects/hashes must be strings)). The order correspond to the :merge directive in the concurrence expression. http://ruote.rubyforge.org/exp/concurrence.html 'first' means that the workitems will be ordered with the first branch to have replied to the concurrence (or concurrent-iterator) first in the list. 'last' means the workitem coming from the last branch to reply will be first. 'highest' preserves the order you defined when listing the concurrent branches. For example : ---8<--- concurrence :merge => :highest, merge_type => :isolate do alpha bravo end --->8--- will produce a workitem that look like 'fields' => { '0' => { ... fields after 'alpha' ... }, '1' => { ... fields after 'bravo' ... } }, 'lowest' will reverse that order. I'm considering implementing a replacement for 'isolate' named 'stack' (not sure about the name now). Thus, ---8<--- concurrence :merge => :highest, merge_type => :stack do alpha bravo end --->8--- would produce a workitem looking like 'fields' => { 'stack' => [ { ... fields after 'alpha' ... }, { ... fields after 'bravo' ... } ] } Tell me what you (and others on the list think). It might be way simpler that the current 'isolate' behaviour. Best regards, -- John Mettraux - http://jmettraux.wordpress.com -- you received this message because you are subscribed to the "ruote users" group. to post : send email to [email protected] to unsubscribe : send email to [email protected] more options : http://groups.google.com/group/openwferu-users?hl=en
