You could call context.unwatch(worker) and then context.stop(worker) from 
your supervisor actor.  Then you won't get the Terminated message, though 
you also won't find out about a crash if the actor were the die for 
whatever reason before being stopped.

For the reason I might lean towards just keeping track of stopped actors 
and checking if a Terminated message is for one that's already been 
stopped, though I suppose that could suffer from the same flaw.

On Monday, July 7, 2014 5:24:32 PM UTC-6, Greg Flanagan wrote:
>
> I'm using the working pull pattern and wanted to be able to spawn and reap 
> workers while the application is running. Spinning up new workers is 
> trivial but I had some questions about terminating current workers. 
> Currently I'll send a worker a PoisonPill to get it to shut down but when I 
> do this I can't discriminate between a worker that just crashed and one 
> that I sent a PoisonPill to. The master could just keep a Set of worker 
> that where sent a PoisonPill, that would at least tell me if it was a crash 
> or a request to shut down. I wanted to know if there is another way of 
> terminating a child node without sending it a PoisonPill or if there is 
> just a better way to do all this.
>
> Thanks,
> Greg  
>

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

Reply via email to