Hi Konrad,

Thanks a lot, these are excellent examples. I'm sure that's pretty common 
pattern, so putting it in docs seems like a good idea.

In my case Sink.onComplete was enough (simply as a replecement for 
Sink.ignore). However it was kind of tricky to move MaterializedMap to 
"outer scope" for a running flow in this recursive-like construct - I used 
additional actor as a proxy. I bet there's no one fits all solution for 
this kind of problems but I'd really love to see what suger will you come 
up with.

Kind regards,
Łukasz

W dniu wtorek, 17 lutego 2015 00:14:21 UTC+1 użytkownik Konrad Malawski 
napisał:
>
> Hi Łukasz,
> That's one of the patterns we should include in the docs I think - I opened 
> an issue <https://github.com/akka/akka/issues/16882> for it.
>
> In general you'll want to have a processing stage in your handler Flow 
> which is able to react to completion.
> Examples of such elements are either broadcasting into an Sink.onComplete, 
> or implementing a PushStage.
>
> Here's two example implementations, handler1 and handler2: 
> https://gist.github.com/ktoso/4dda7752bf6f4393d1ac
>
> They're not perfect, I'll probably polish them and include in the docs, as 
> for example you'd usually want to have a small delay
> before you try to reconnect and not immediately like in the above example, 
> however the general idea stands.
>
> As this may well be a rather typical task to do we may provide some sugar 
> for it eventually.
>
>
> On Sun, Feb 15, 2015 at 3:52 AM, Łukasz Sowa <[email protected] 
> <javascript:>> wrote:
>
>> Hi,
>>
>> In my application I have a quite complex flow built on top of long-lived 
>> http connection (via `Http().outgoingConnection`). If the other end 
>> (server) of this connection goes down (connection is terminated) the whole 
>> stream collapses and stays indefinitely in this state. However, in case of 
>> failure I'd like to simply try to reconnect to server - some requests might 
>> be lost but I'm ok with that. What's the recommended way of implementing 
>> such behaviour? I'd prefer not to re-build and re-materialize whole flow.
>>
>> Best,
>> Łukasz Sowa
>>
>> -- 
>> >>>>>>>>>> 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.
>>
>
>
>
> -- 
> Cheers,
> Konrad 'ktoso' Malawski
> Akka <http://akka.io/> @ Typesafe <http://typesafe.com/>
>
> JOIN US. REGISTER TODAY! 
> <http://event.scaladays.org/scaladays-sanfran-2015>
> Scala <http://event.scaladays.org/scaladays-sanfran-2015>
> Days <http://event.scaladays.org/scaladays-sanfran-2015>
> March 16th-18th, <http://event.scaladays.org/scaladays-sanfran-2015>
> San Francisco <http://event.scaladays.org/scaladays-sanfran-2015>
>  

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