On Wed, Mar 20, 2013 at 07:13:19AM -0700, [email protected] wrote:
>
> I'm a ruby/route newbie.
>
> Is it possible to :await a list of tags (when all of them completed) ?
> If not, is there a way to add a ruby for loop that would produce the same
> effect?

Hello Itai,

welcome to the ruote mailing list.

Next time, could you please start a new thread of conversation, please don't
bring back old threads (of course, you can reference them via links). Thanks
in advance!

Stepping back a bit, when you want to wait for a bunch of branches to
terminate, you wrap them in a concurrence:

```
  concurrence do
    branch1
    branch2
    branch3
  end # will exit when all the branches exit
```

Maybe that's all you need, maybe you're looking at those await attributes and
thinking they're cool, but all you need is a simple concurrence...

OK, you still need tags? Let's try to deal with your requirement.


> Is it possible to :await a list of tags (when all of them completed) ?

```
  concurrence do

    branch1 :tag => 'a'
    branch2 :tag => 'b'

    sequence do
      concurrence do
        await 'a'
        await 'b'
      end # will exit when both await exit
      branch9
    end
  end
```

but I find it simpler to write:

```
  sequence do
    concurrence do
      branch1
      branch2
    end
    branch9
  end
```

Please look for simpler patterns. If you really need the complicated stuff,
tell me.


> If not, is there a way to add a ruby for loop that would produce the same
> effect?

You're a Ruby newbie and a ruote newbie. You should probably focus on Ruby
first and get back to ruote if necessary.


I hope it helps, Best regards,

--
John Mettraux - http://lambda.io/jmettraux

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"ruote" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to