public class Dispatcher extends MessageDispatcher
Dispatcher binds a set of Actors to a thread pool backed up by a
BlockingQueue.
The preferred way of creating dispatchers is to define configuration of it and use the
the lookup method in Dispatchers.
| Constructor and Description |
|---|
Dispatcher(MessageDispatcherConfigurator _configurator,
java.lang.String id,
int throughput,
scala.concurrent.duration.Duration throughputDeadlineTime,
ExecutorServiceFactoryProvider executorServiceFactoryProvider,
scala.concurrent.duration.FiniteDuration shutdownTimeout) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.ThreadLocal<scala.collection.immutable.List<java.lang.Runnable>> |
_tasksLocal() |
boolean |
batchable(java.lang.Runnable runnable)
Override this to define which runnables will be batched.
|
protected akka.dispatch.Mailbox |
createMailbox(akka.actor.Cell actor,
MailboxType mailboxType)
INTERNAL API
|
protected void |
dispatch(akka.actor.ActorCell receiver,
Envelope invocation)
INTERNAL API
|
void |
execute(java.lang.Runnable runnable) |
protected void |
executeTask(TaskInvocation invocation)
INTERNAL API
|
protected ExecutorServiceDelegate |
executorService() |
java.lang.String |
id()
Identifier of this dispatcher, corresponds to the full key
of the dispatcher configuration.
|
protected boolean |
registerForExecution(akka.dispatch.Mailbox mbox,
boolean hasMessageHint,
boolean hasSystemMessageHint)
Returns if it was registered
|
protected void |
shutdown()
INTERNAL API
|
scala.concurrent.duration.FiniteDuration |
shutdownTimeout()
When the dispatcher no longer has any actors registered, how long will it wait until it shuts itself down,
defaulting to your akka configs "akka.actor.default-dispatcher.shutdown-timeout" or default specified in
reference.conf
|
protected void |
systemDispatch(akka.actor.ActorCell receiver,
akka.dispatch.sysmsg.SystemMessage invocation)
INTERNAL API
|
int |
throughput()
INTERNAL API
|
scala.concurrent.duration.Duration |
throughputDeadlineTime()
INTERNAL API
|
java.lang.String |
toString() |
actors, attach, configurator, debug, detach, eventStream, inhabitants, isThroughputDeadlineTimeDefined, mailboxes, printActors, register, reportFailure, RESCHEDULED, resume, SCHEDULED, suspend, unbatchedExecute, unregister, UNSCHEDULEDpublic Dispatcher(MessageDispatcherConfigurator _configurator, java.lang.String id, int throughput, scala.concurrent.duration.Duration throughputDeadlineTime, ExecutorServiceFactoryProvider executorServiceFactoryProvider, scala.concurrent.duration.FiniteDuration shutdownTimeout)
public java.lang.String id()
MessageDispatcherid in class MessageDispatcherpublic int throughput()
MessageDispatcherthroughput in class MessageDispatcherpublic scala.concurrent.duration.Duration throughputDeadlineTime()
MessageDispatcherthroughputDeadlineTime in class MessageDispatcherpublic scala.concurrent.duration.FiniteDuration shutdownTimeout()
MessageDispatcherINTERNAL API
shutdownTimeout in class MessageDispatcherprotected final ExecutorServiceDelegate executorService()
protected void dispatch(akka.actor.ActorCell receiver,
Envelope invocation)
dispatch in class MessageDispatcherprotected void systemDispatch(akka.actor.ActorCell receiver,
akka.dispatch.sysmsg.SystemMessage invocation)
systemDispatch in class MessageDispatcherprotected void executeTask(TaskInvocation invocation)
executeTask in class MessageDispatcherprotected akka.dispatch.Mailbox createMailbox(akka.actor.Cell actor,
MailboxType mailboxType)
createMailbox in class MessageDispatcherprotected void shutdown()
shutdown in class MessageDispatcherprotected boolean registerForExecution(akka.dispatch.Mailbox mbox,
boolean hasMessageHint,
boolean hasSystemMessageHint)
INTERNAL API
registerForExecution in class MessageDispatcherpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.ThreadLocal<scala.collection.immutable.List<java.lang.Runnable>> _tasksLocal()
public void execute(java.lang.Runnable runnable)
execute in interface java.util.concurrent.Executorpublic boolean batchable(java.lang.Runnable runnable)