Adding support for completing senderFutures when actor is stopped, closing ticket #894. Also renaming DurableEventBasedDispatcher to DurableDispatcher

This commit is contained in:
Viktor Klang 2011-05-26 20:38:42 +02:00
parent e94b722a4b
commit 49883d8c59
8 changed files with 61 additions and 16 deletions

View file

@ -147,6 +147,7 @@ trait MessageDispatcher {
private[akka] def unregister(actorRef: ActorRef) = {
if (uuids remove actorRef.uuid) {
cleanUpMailboxFor(actorRef)
actorRef.mailbox = null
if (uuids.isEmpty && futures.get == 0) {
shutdownSchedule match {
@ -161,6 +162,12 @@ trait MessageDispatcher {
}
}
/**
* Overridable callback to clean up the mailbox for a given actor,
* called when an actor is unregistered.
*/
protected def cleanUpMailboxFor(actorRef: ActorRef) {}
/**
* Traverses the list of actors (uuids) currently being attached to this dispatcher and stops those actors
*/