Allow different types of mailboxes on the same dispatcher. See #2687

This commit is contained in:
Björn Antonsson 2013-04-18 13:35:36 +02:00
parent c86cc0b8f7
commit c3eed374f1
32 changed files with 735 additions and 74 deletions

View file

@ -14,6 +14,8 @@ import scala.concurrent.forkjoin.ForkJoinPool
import scala.concurrent.duration.Duration
import scala.concurrent.Awaitable
import scala.concurrent.duration.FiniteDuration
import scala.annotation.tailrec
import java.lang.reflect.ParameterizedType
/**
* The event-based ``Dispatcher`` binds a set of Actors to a thread pool backed up by a
@ -33,6 +35,7 @@ class Dispatcher(
val throughput: Int,
val throughputDeadlineTime: Duration,
val mailboxType: MailboxType,
val mailboxTypeConfigured: Boolean,
executorServiceFactoryProvider: ExecutorServiceFactoryProvider,
val shutdownTimeout: FiniteDuration)
extends MessageDispatcher(_prerequisites) {
@ -86,8 +89,9 @@ class Dispatcher(
/**
* INTERNAL API
*/
protected[akka] def createMailbox(actor: akka.actor.Cell): Mailbox =
new Mailbox(mailboxType.create(Some(actor.self), Some(actor.system))) with DefaultSystemMessageQueue
protected[akka] def createMailbox(actor: akka.actor.Cell): Mailbox = {
new Mailbox(getMailboxType(actor, mailboxType, mailboxTypeConfigured).create(Some(actor.self), Some(actor.system))) with DefaultSystemMessageQueue
}
/**
* INTERNAL API