public class CallingThreadDispatcher extends MessageDispatcher
Suspending and resuming are global actions for one actor, meaning they can affect different threads, which leads to complications. If messages are queued (thread-locally) during the suspendSwitch period, the only thread to run them upon resume is the thread actually calling the resume method. Hence, all thread-local queues which are not currently being drained (possible, since suspend-queue-resume might happen entirely during an invocation on a different thread) are scooped up into the current thread-local queue which is then executed. It is possible to suspend an actor from within its call stack.
| Constructor and Description |
|---|
CallingThreadDispatcher(MessageDispatcherConfigurator _configurator) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
akka$dispatch$BatchingExecutor$_setter_$akka$dispatch$BatchingExecutor$$_blockContext_$eq(java.lang.ThreadLocal<scala.concurrent.BlockContext> x$1) |
protected static void |
akka$dispatch$BatchingExecutor$_setter_$akka$dispatch$BatchingExecutor$$_tasksLocal_$eq(java.lang.ThreadLocal<BatchingExecutor.AbstractBatch> x$1) |
static java.lang.ThreadLocal<scala.concurrent.BlockContext> |
akka$dispatch$BatchingExecutor$$_blockContext() |
static java.lang.ThreadLocal<BatchingExecutor.AbstractBatch> |
akka$dispatch$BatchingExecutor$$_tasksLocal() |
static void |
attach(ActorCell actor) |
static boolean |
batchable(java.lang.Runnable runnable) |
static MessageDispatcherConfigurator |
configurator() |
protected CallingThreadMailbox |
createMailbox(Cell actor,
MailboxType mailboxType)
Creates and returns a mailbox for the given actor.
|
static void |
detach(ActorCell actor) |
protected void |
dispatch(ActorCell receiver,
Envelope handle)
Will be called when the dispatcher is to queue an invocation for execution
|
static EventStream |
eventStream() |
static void |
execute(java.lang.Runnable runnable) |
protected void |
executeTask(TaskInvocation invocation)
INTERNAL API
|
java.lang.String |
id()
Identifier of this dispatcher, corresponds to the full key
of the dispatcher configuration.
|
static java.lang.String |
Id() |
static long |
inhabitants() |
protected static boolean |
isThroughputDeadlineTimeDefined() |
LoggingAdapter |
log() |
static Mailboxes |
mailboxes() |
static scala.concurrent.ExecutionContext |
prepare() |
protected void |
register(ActorCell actor)
If you override it, you must call it.
|
protected boolean |
registerForExecution(Mailbox mbox,
boolean hasMessageHint,
boolean hasSystemMessageHint)
Suggest to register the provided mailbox for execution
|
static void |
reportFailure(java.lang.Throwable t) |
protected static boolean |
resubmitOnBlock() |
protected void |
resume(ActorCell actor) |
protected void |
shutdown()
Called one time every time an actor is detached from this dispatcher and this dispatcher has no actors left attached
Must be idempotent
|
protected 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 |
suspend(ActorCell actor)
After the call to this method, the dispatcher mustn't begin any new message processing for the specified reference
|
protected void |
systemDispatch(ActorCell receiver,
SystemMessage message)
Will be called when the dispatcher is to queue an invocation for execution
|
protected int |
throughput()
INTERNAL API
|
protected scala.concurrent.duration.FiniteDuration |
throughputDeadlineTime()
INTERNAL API
|
protected static void |
unbatchedExecute(java.lang.Runnable r) |
protected void |
unregister(ActorCell actor)
If you override it, you must call it.
|
actors, attach, configurator, debug, detach, eventStream, inhabitants, isThroughputDeadlineTimeDefined, mailboxes, printActors, reportFailure, RESCHEDULED, resubmitOnBlock, SCHEDULED, unbatchedExecute, UNSCHEDULEDclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbatchable, executepublic CallingThreadDispatcher(MessageDispatcherConfigurator _configurator)
public static java.lang.String Id()
public static void execute(java.lang.Runnable runnable)
public static boolean batchable(java.lang.Runnable runnable)
public static scala.concurrent.ExecutionContext prepare()
public static MessageDispatcherConfigurator configurator()
public static Mailboxes mailboxes()
public static EventStream eventStream()
public static final long inhabitants()
public static final void attach(ActorCell actor)
public static final void detach(ActorCell actor)
protected static final boolean resubmitOnBlock()
protected static final void unbatchedExecute(java.lang.Runnable r)
public static void reportFailure(java.lang.Throwable t)
protected static final boolean isThroughputDeadlineTimeDefined()
public static java.lang.ThreadLocal<BatchingExecutor.AbstractBatch> akka$dispatch$BatchingExecutor$$_tasksLocal()
public static java.lang.ThreadLocal<scala.concurrent.BlockContext> akka$dispatch$BatchingExecutor$$_blockContext()
protected static final void akka$dispatch$BatchingExecutor$_setter_$akka$dispatch$BatchingExecutor$$_tasksLocal_$eq(java.lang.ThreadLocal<BatchingExecutor.AbstractBatch> x$1)
protected static final void akka$dispatch$BatchingExecutor$_setter_$akka$dispatch$BatchingExecutor$$_blockContext_$eq(java.lang.ThreadLocal<scala.concurrent.BlockContext> x$1)
public LoggingAdapter log()
public java.lang.String id()
MessageDispatcherid in class MessageDispatcherprotected CallingThreadMailbox createMailbox(Cell actor, MailboxType mailboxType)
MessageDispatchercreateMailbox in class MessageDispatcheractor - (undocumented)mailboxType - (undocumented)protected void shutdown()
MessageDispatcherINTERNAL API
shutdown in class MessageDispatcherprotected int throughput()
MessageDispatcherthroughput in class MessageDispatcherprotected scala.concurrent.duration.FiniteDuration throughputDeadlineTime()
MessageDispatcherthroughputDeadlineTime in class MessageDispatcherprotected boolean registerForExecution(Mailbox mbox, boolean hasMessageHint, boolean hasSystemMessageHint)
MessageDispatcherINTERNAL API
registerForExecution in class MessageDispatchermbox - (undocumented)hasMessageHint - (undocumented)hasSystemMessageHint - (undocumented)protected scala.concurrent.duration.FiniteDuration shutdownTimeout()
MessageDispatcherINTERNAL API
shutdownTimeout in class MessageDispatcherprotected void register(ActorCell actor)
MessageDispatcherINTERNAL API
register in class MessageDispatcheractor - (undocumented)protected void unregister(ActorCell actor)
MessageDispatcherINTERNAL API
unregister in class MessageDispatcheractor - (undocumented)protected void suspend(ActorCell actor)
MessageDispatchersuspend in class MessageDispatcheractor - (undocumented)protected void resume(ActorCell actor)
resume in class MessageDispatcherprotected void systemDispatch(ActorCell receiver, SystemMessage message)
MessageDispatcherINTERNAL API
systemDispatch in class MessageDispatcherreceiver - (undocumented)message - (undocumented)protected void dispatch(ActorCell receiver, Envelope handle)
MessageDispatcherINTERNAL API
dispatch in class MessageDispatcherreceiver - (undocumented)handle - (undocumented)protected void executeTask(TaskInvocation invocation)
MessageDispatcherexecuteTask in class MessageDispatcherinvocation - (undocumented)