Hey Endre,
Thanks for the response but I don't quite understand how to implement what
you're suggesting. I did find the Fold class but it has no Promise/Future
in it. I also found the FoldSink class but the only way to get a future
back from that is to use the attach method and I've no idea how to get that
into my flow. Any example how to do this?
Here's what I'm working with currently:
val connection = StreamTcp().outgoingConnection(address)
val handler: Flow[ByteString, ByteString] =
Flow[ByteString].mapConcat(frameReconciler.reconcile)
.map(decodeRequest).map(handleRequest).map(encodeResponse).map(createFrame)
connection.handleWith(handler)
Best regards,
Cole
On Friday, January 23, 2015 at 8:55:32 AM UTC-8, drewhk wrote:
>
> Hi Cole,
>
> The connection disconnect event will be signalled as stream completion to
> the reading stream and cancellation to the writing stream. For example if
> you fold over the ouput stream of the TCP connection, on TCP closure
> (assuming normal close event) the fold element will emit the final result
> in its corresponding Future.
>
> -Endre
>
> On Fri, Jan 23, 2015 at 10:17 AM, <[email protected] <javascript:>>
> wrote:
>
>> Hey all,
>>
>> After making a StreamTcp().outgoingConnection(address) connection, how
>> can I watch the connection for disconnects so that I can establish a new
>> connection? I see a akka.io.Tcp$ConfirmedClosed$ and
>> a akka.actor.Terminated getting logged in dead letters after the server
>> restarts but no idea how I can get ahold of them or if there's a better way.
>>
>> Thanks in advance,
>> Cole
>>
>> --
>> >>>>>>>>>> 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] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> 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 [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.