W dniu czwartek, 27 października 2016 19:29:14 UTC+2 użytkownik auxdx
napisał:
>
> There might be several consumers. Each consumer has an type; For
> "EvenConsumer"; it expects to receive ONLY even numbers; for "OddConsumer",
> it expects to receive ONLY odd number; If at the beginning; old
> EvenConsumer join the Hub; even number from the datasource will be sent to
> evenconsumer; where odd number from data will be ignore; later on,
> OddConsumer might joined, and it will receive odd number from data source.
>
> Are types of consumers fixed up front? What happens when an event arrives
for which there is no suitable consumer connected at the moment?
If the answers are yes, upstream is backpressured, you could implement it
with standard graph stages:
in ~> Broadcast ~> Filter (even) ~> BroadcastHub
\
~> Filter (odd) ~> BroadcastHub
You'll need to do some materialized value wrangling, because you'd need to
get a hold on both of the values produced by broadcast hubs.
If you need more flexibility, you'll have to implement a CustomGraph stage
that will provide a materialized value allowing attaching consumers, just
like BroadcastHub does.
cheers,
Rafał
--
>>>>>>>>>> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.