Call 'shutdown' on the ActorSystem? Or only the Materializer?

On Fri, Apr 1, 2016 at 11:29 AM, paweł kamiński <kami...@gmail.com> wrote:

> I want to clean state of the app, so I could
>
> 1) terminate akka-system which would also terminate http-server and start
> it all over again.
> OR
> 2) I thought about shutting down just http-server in reaction to some
> fault state of actors hierarchy.
>
> Konrad's comment states that it is not enough just to unbind from port, as
> active connection and their flows are operating, so I need to terminate
> each flow after unbinding.
> At this point I have no other requirements.
>
> On Friday, 1 April 2016 11:05:57 UTC+2, √ wrote:
>>
>> When you say "cancel" do you mean "abrupt termination" or something with
>> a code path attached to it?
>>
>> On Thu, Mar 31, 2016 at 11:53 PM, paweł kamiński <kam...@gmail.com>
>> wrote:
>>
>>> dont take it personally, there is a lot to process and sometimes it is
>>> easy to overlook the most important part, I guess I didn't get the context
>>> of the last sentence.
>>>
>>> thanks
>>>
>>> On Thursday, 31 March 2016 23:45:03 UTC+2, Konrad Malawski wrote:
>>>>
>>>> In 2.4.2 you can do the same in a GraphStage (read up on custom stream
>>>> processing – cancel() and friends).
>>>>
>>>> --
>>>> Cheers,
>>>> Konrad 'ktoso’ Malawski
>>>> <http://akka.io>Akka <http://akka.io> @ Lightbend <http://typesafe.com>
>>>> <http://lightbend.com>
>>>>
>>>> On 31 March 2016 at 23:38:30, paweł kamiński (kam...@gmail.com) wrote:
>>>>
>>>> hej Konrad, can you please point me to any documentation describing how
>>>> to manually cancel living flow? the official documentation assumes that
>>>> flows are infinite or eventually source will be drained - so no problem.
>>>> I cannot find any section on the topic of cancelling flows
>>>> subscription.
>>>>
>>>> On Wednesday, 30 March 2016 10:39:35 UTC+2, paweł kamiński wrote:
>>>>>
>>>>> I thought bold is new black, coming back with a bang...
>>>>>
>>>>> ok, your explanation makes kind of sense ;] all I expected was a
>>>>> shutdown method with timeout.
>>>>> and yeah a section with examples would be nice and I can write one
>>>>> once I understand how it works ;]
>>>>>
>>>>> I understand that I need to hold each connection and then iterate over
>>>>> them after unbind.
>>>>> but I need a hint how to "cancels flows upstream subscription", I
>>>>> can't see any useful method on connection or connection.flow().
>>>>>
>>>>> and one more thing - until now I thought that creating flow from actor
>>>>> will make such flow child of the actor, so closing actor would close also
>>>>> flow's actors, obviously it is not and flow is keep on consuming incoming
>>>>> messages even though actor is long gone.
>>>>>
>>>>> On Wednesday, 30 March 2016 00:32:24 UTC+2, Konrad Malawski wrote:
>>>>>>
>>>>>> Helloł,
>>>>>>
>>>>>> I notice that after unbind I cannot create new connection (ie. from a
>>>>>> browser) but old, alive connection can still send requests. Am I missing
>>>>>> something?
>>>>>>
>>>>>> Please no bold to highlight question, it looks scary :-)
>>>>>>
>>>>>> That's exactly how it works, by design. I did notice however that we
>>>>>> do not have a shutting down section for the low level API, we should add
>>>>>> that - thanks -> https://github.com/akka/akka/issues/20177
>>>>>>
>>>>>> Would be awesome if you'd perhaps step up and help contributing a
>>>>>> beginning of that docs section :-)
>>>>>>
>>>>>> Just looking at
>>>>>> http://doc.akka.io/docs/akka/2.4.2/java/http/server-side/low-level-server-side-api.html#starting-and-stopping
>>>>>> I guess I do the right thing.
>>>>>> but I cannot understand a fragment from
>>>>>> http://doc.akka.io/docs/akka/2.4.2/java/http/server-side/low-level-server-side-api.html#Closing_a_connection,
>>>>>> "The HTTP connection will be closed when the handling Flow cancels
>>>>>> its upstream subscription".
>>>>>> Should I manually close connection after unbinding? that would be
>>>>>> strange, I just want to unbind and shutdown, closing all live 
>>>>>> connections.
>>>>>>
>>>>>> No, it's not strange for two reasons: a) it's "unbind" which means
>>>>>> "release that port, I won't be accepting anything new on it", and it also
>>>>>> it is b) the behaviour one wants for  it's called graceful shutdown – 
>>>>>> serve
>>>>>> the people that already sent you requests, and stop accepting new ones,
>>>>>> then shut down.
>>>>>>
>>>>>> The "shutdown now and drop everything on the floor" can already be
>>>>>> achieved in a rather brutal way – killing the ActorSystem, however the
>>>>>> feature is on our radar however it's a new feature: shutdownNow on
>>>>>> github <https://github.com/akka/akka/issues/20069>.
>>>>>>
>>>>>>
>>>>>> For injecting "external termination" intro streams, we have
>>>>>> KillSwitch prepared which will likely ship with 2.4.3.
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Cheers,
>>>>>> Konrad 'ktoso’ Malawski
>>>>>> <http://akka.io>Akka <http://akka.io> @ Lightbend
>>>>>> <http://typesafe.com>
>>>>>>
>>>>>> <http://lightbend.com>
>>>>>>
>>>>> --
>>>> >>>>>>>>>> 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+...@googlegroups.com.
>>>> To post to this group, send email to akka...@googlegroups.com.
>>>> Visit this group at https://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 akka-user+...@googlegroups.com.
>>> To post to this group, send email to akka...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Cheers,
>> √
>>
> --
> >>>>>>>>>> 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 https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Cheers,
√

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

Reply via email to