AkkaApplication: Make EventHandler the last stopped Actor
Problem: When using Actor.registry.shutdownAll() the actors are stopped in an undefined order, including any EventHandler. This makes it impossible (at least highly unlikely) to use "logging" via EventHandler in Actor.postStop().
First idea after discussing this on the mailing list: Actor.registry.shutdownAll() stops all actors except for EventHandler first, then sends poison pills to these.
First idea after discussing this on the mailing list: Actor.registry.shutdownAll() stops all actors except for EventHandler first, then sends poison pills to these.
Leave a comment
on 2011-05-15 03:45 *
By Heiko Seeberger
Assigned to set to Heiko Seeberger
Description changed from Problem: When using _Actor.... to Problem: When using _Actor....
on 2011-05-20 06:48 *
By Patrik Nordwall
I don't think we should add special things for the event handler listeners in the api. They are like any other actor, and application specific listeners can be added in runtime to the EventHandler. There is foreach and filter method in ActorRegistry so it would be easy to do special shutdown if needed.
I think the tricky part of this is how do we know that an actor is an event handler listener?
I think the tricky part of this is how do we know that an actor is an event handler listener?
on 2011-05-21 02:12 *
By rkuhn
Assigned to changed from Heiko Seeberger to rkuhn
Status changed from New to Accepted
I have an idea, will try it on 1.2 first.
See last two commits on testkit branch: I introduced a generic shutdownLevel to Actor/ActorRegistry and used that to configure the EventHandler.DefaultListener to be stopped late (user configurable). This should then be applied to all other actors started/used by the toolkit, if the method is accepted.
on 2011-08-11 13:42 *
By viktorklang
I'm not really a huge fan of shutdownAll... should be more like "killAll" so people don't expect any ordering or otherwise, should be a crash-only thing, right?
on 2011-10-07 09:23 *
By viktorklang
Summary changed from Make EventHandler the last stopped Actor to AkkaApplication: Make EventHandler the last stopped Actor