How split a flow?

26 views
Skip to first unread message

john....@gmail.com

unread,
Jul 30, 2015, 2:50:38 PM7/30/15
to Akka User List
How do I split a flow? 
For example if I have a Source of ints that I want to split in even and uneven. Do I have to connect it to a graph(Broadcast.create(2)) and then filter on each of out channels?

Konrad Malawski

unread,
Jul 30, 2015, 2:53:24 PM7/30/15
to akka...@googlegroups.com, john....@gmail.com
Hi there,
you could do it like you mention (pseudocode):

Broadcast ~> Flow[].filter(even) ~>
Broadcast ~> Flow[].filter(odd) ~>

However we have a built-in that serves those kinds of "route things depending on something" situations well: FlexiRoute


Happy hakking!

-- 
Cheers,
Konrad 'ktoso’ Malawski
Akka @ Typesafe

On 30 July 2015 at 20:50:43, john....@gmail.com (john....@gmail.com) wrote:

How do I split a flow? 
For example if I have a Source of ints that I want to split in even and uneven. Do I have to connect it to a graph(Broadcast.create(2)) and then filter on each of out channels?
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages