split Mailbox and MessageQueue, see #1844

- this enables using any MessageQueue in BalancingDispatcher,
  CallingThreadDispatcher and in general leads to less conflation of
  concepts
- add MessageQueue.cleanUp(owner, deadLetterQueue) for the benefit of
  durable mailboxes
- change MailboxType.create to take an optional owner and generate only
  a MessageQueue, not a Mailbox
This commit is contained in:
Roland 2012-02-19 10:28:56 +01:00
parent 62be4dafee
commit 2f3737195b
18 changed files with 171 additions and 144 deletions

View file

@ -40,7 +40,7 @@ class Dispatcher(
protected[akka] def dispatch(receiver: ActorCell, invocation: Envelope) = {
val mbox = receiver.mailbox
mbox.enqueue(receiver.self, invocation)
mbox.messageQueue.enqueue(receiver.self, invocation)
registerForExecution(mbox, true, false)
}
@ -65,7 +65,7 @@ class Dispatcher(
}
}
protected[akka] def createMailbox(actor: ActorCell): Mailbox = mailboxType.create(actor)
protected[akka] def createMailbox(actor: ActorCell): Mailbox = new Mailbox(actor, mailboxType.create(Some(actor))) with DefaultSystemMessageQueue
protected[akka] def shutdown: Unit =
Option(executorService.getAndSet(new ExecutorServiceDelegate {