This can also be done with a custom GraphStage. Those do not have
documentation yet, though.

-Endre

On Fri, Nov 20, 2015 at 1:34 PM, Patrik Nordwall <patrik.nordw...@gmail.com>
wrote:

>
>
> On Fri, Nov 20, 2015 at 10:08 AM, Leon Ma <tutuf...@gmail.com> wrote:
>
>> Hi,
>>
>> I'd like to apply different sub flows against attributes of input
>> elements.
>>
>> For example, for my source of HttpRequest:
>>
>> if (contains HttpHeader A) then go thru flowA
>> if (contains HttpHeader B) then go thru flowB
>> else go thru flowC
>>
>> I got some ideas from thread:
>> https://groups.google.com/forum/#!topic/akka-user/b4xL1iU9QHU
>>
>> That I can use Broadcast + filter to do sub flow branching like:
>>
>> Source~> bcast ~> filterToSelectA~> FlowA ~> merge
>>                              ~> filterToSelectB ~> FlowB  ~> merge
>>                               ~> filterElse  ~> FlowC ~> merge
>>                                                              ~> merge.out
>> ~> ...
>>
>> However, if the filter itself is heavy (like calling a service), we might
>> need to pay extra cost for each branch.
>> So I'm thinking of whether there's a way to do "Conditional" Balance that
>> do filter evaluation Before dispatching. (pre-filter vs post-filter)
>>
>
> Perhaps you can perform the decision in a stage before the bcast and pass
> it on (in the element) so that the filters have low cost.
>
> /Patrik
>
>
>>
>> Any suggestion?
>>
>>
>> Thanks
>> Leon
>>
>> --
>> >>>>>>>>>> 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+unsubscr...@googlegroups.com.
>> To post to this group, send email to akka-user@googlegroups.com.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> Patrik Nordwall
> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
> Twitter: @patriknw
>
> --
> >>>>>>>>>> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>      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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to