Hello Martynas,

Thank you for your response and suggestions.I had already a supervisor so 
the changes was easy. The only thing that I'm not confident with is the 
fact to maintains a List of sent events and remove them when I have a reply 
so that I can kill the actor when all events are replied.
If you want, the code is on 
https://github.com/gervaisb/tamales/tree/feature/self_stop and the actor 
that collect events is Evernote 
<https://github.com/gervaisb/tamales/blob/feature/self_stop/src/main/scala/com/github/tamales/impls/Evernote.scala>
.


Have a good day.

On Friday, 24 November 2017 15:06:43 UTC+1, Martynas Mickevičius wrote:
>
> Hi,
>
> your approach sounds good. You can also have one parent supervisor actor, 
> which when sees that all of its children has been stopped, would shut down 
> the actor system itself.
>
>
>
> On Tue, Nov 21, 2017 at 11:23 AM gervais.b <[email protected] 
> <javascript:>> wrote:
>
>> Hello there. 
>>
>> I have a system that I would like to shutdown when all actors are 
>> terminated. My system contains two supervisors with some of actors for each 
>> of them.
>> The supervisors are watching their children an terminate themselves via a 
>> *PoisonPill 
>> *when there is no more children.
>> Some child actors are just executing one command and *PoisonPill* 
>> themselves after that.
>> But I have some actors that send events and expect a response to those 
>> events. For this case, I have a collection of sent events from which I 
>> remove the events that have been replied so that I can *PoisonPill *the 
>> actor when this collection is empty. 
>>
>> That works but I wonder if there is a better way of waiting for all 
>> responses before doing an action.
>>
>> Thanks
>>
>> -- 
>> >>>>>>>>>> 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 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 [email protected].
To post to this group, send email to [email protected].
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