> On Thu, Oct 30, 2014 at 1:43 PM, Adam Warski <ad...@warski.org 
> <javascript:>> wrote:
>
>> There's an OnCompleteDrain :) (btw. - sink, drain, subscriber - a lot of 
>> names ;) )
>>
>
> Drain is no longer there (as a name at least) and you should usually not 
> see a Subscriber ;)
>

It is in 0.9, but as I understand it's not in master :)
 

> How do I use broadcast, thought? I can see it can be a vertex in the 
>> graph, but how to add it?
>>
>
> An example:
>
>       FlowGraph { implicit b ⇒
>         val bcast = Broadcast[Int]("broadcast")
>         Source(List(1, 2, 3)) ~> bcast
>         bcast ~> Flow[Int] ~> Sink(s1)
>         bcast ~> Flow[Int] ~> Sink(s2)
>       }.run()
>

Thanks, I'll try that.
  

> So I'll end up with sth like this:
>>
>>                                                        /---> sink1 
>> (output stream)
>> source --> trans1 --> broadcast --<
>>                                                        \---> sink2 (on 
>> complete drain)
>>
>> Will the failure of sink1 propagate to a completion of the whole stream? 
>> In theory it could continue in a "crippled" way (with only one branch 
>> remaining).
>>
>
> True, in this setup sink2 will get the termination event of "source" but 
> will not get the canceled event of sink1. Internally it is configurable if 
> broadcast should continue or not in this case but this is not exposed to 
> the users (it continues by default now).
>

So even if sink1 fails, the whole setup will continue? So using sink2 (on 
complete sink/drain) won't have any effect? Is there a way to detect errors 
in such case then?
 

> Btw, in your TCP example you don't use the inputStream of the connection, 
> if you use that stream it will give you the termination events of the TCP 
> connection (normal/error). Output stream can only say "cancelled" but not 
> why.
>

Well this application only sends data, so I don't need the input stream for 
anything.

Even supposing broadcast does work, shouldn't there be some other way to 
detect and handle failures/errors/completions? E.g. wouldn't it make sense 
to add a callback to run()? Or make run() return some kind of Future? 
Creating an artificial broadcast just to detect errors seems not optimal :)

Adam

-- 
>>>>>>>>>>      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