Hi Adam,

On Thu, Oct 30, 2014 at 1:43 PM, Adam Warski <[email protected]> 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 ;)


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


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

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.

-Endre


>
> Thanks!
> Adam
>
> On Thursday, October 30, 2014 1:22:41 PM UTC+1, Akka Team wrote:
>>
>> Hi Adam,
>>
>> You can use broadcast to split out the stream going into the Sink, and
>> then attach to that side of the graph an OnCompleteSink which takes a
>> function callback: Try[Unit] ⇒ Unit which is called during normal and
>> failure termination.
>>
>> -Endre
>>
>> On Thu, Oct 30, 2014 at 12:31 PM, Adam Warski <[email protected]> wrote:
>>
>>> Sure :) I'm using streams 0.9, scaladsl2 and I want to add failure
>>> detection to that:
>>>
>>> https://github.com/adamw/reactmq/blob/master/src/main/
>>> scala/com/reactmq/Sender.scala
>>>
>>> Adam
>>>
>>> On Thursday, October 30, 2014 12:04:23 PM UTC+1, Akka Team wrote:
>>>>
>>>> Hi Adam,
>>>>
>>>>
>>>>> I'm not running Windows (MacOS), but how could these signals be
>>>>> handled? I was looking for some handlers in the value returned by run()
>>>>> (e.g. onComplete, onError), but it seems not much is there :)
>>>>>
>>>>
>>>> Which version of Akka Stream are you using and which version of the
>>>> scaladsl? How does your pipeline look like, what is the sink element (the
>>>> thing in which you pipe TCP into).
>>>>
>>>> In general, a code snippet would help a lot.
>>>>
>>>> -Endre
>>>>
>>>>
>>>>>
>>>>> Thanks,
>>>>> Adam
>>>>>
>>>>> --
>>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/c
>>>>> urrent/additional/faq.html
>>>>> >>>>>>>>>> Search the archives: https://groups.google.com/grou
>>>>> p/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 http://groups.google.com/group/akka-user.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Akka Team
>>>> Typesafe - The software stack for applications that scale
>>>> Blog: letitcrash.com
>>>> Twitter: @akkateam
>>>>
>>>  --
>>> >>>>>>>>>> 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 http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Akka Team
>> Typesafe - The software stack for applications that scale
>> Blog: letitcrash.com
>> Twitter: @akkateam
>>
>  --
> >>>>>>>>>> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

-- 
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to