akka.testkit

CallingThreadDispatcher

class CallingThreadDispatcher extends MessageDispatcher

Dispatcher which runs invocations on the current thread only. This dispatcher does not create any new threads, but it can be used from different threads concurrently for the same actor. The dispatch strategy is to run on the current thread unless the target actor is either suspendSwitch or already running on the current thread (if it is running on a different thread, then this thread will block until that other invocation is finished); if the invocation is not run, it is queued in a thread-local queue to be executed once the active invocation further up the call stack finishes. This leads to completely deterministic execution order if only one thread is used.

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.

Since

1.1

Linear Supertypes
MessageDispatcher, ExecutionContext, BatchingExecutor, Executor, AbstractMessageDispatcher, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CallingThreadDispatcher
  2. MessageDispatcher
  3. ExecutionContext
  4. BatchingExecutor
  5. Executor
  6. AbstractMessageDispatcher
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CallingThreadDispatcher(_prerequisites: DispatcherPrerequisites, mailboxType: MailboxType, name: String = "calling-thread")

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. final def attach(actor: ActorCell): Unit

    Attaches the specified actor instance to this dispatcher, which includes scheduling it to run for the first time (Create() is expected to have been enqueued by the ActorCell upon mailbox creation).

    Attaches the specified actor instance to this dispatcher, which includes scheduling it to run for the first time (Create() is expected to have been enqueued by the ActorCell upon mailbox creation).

    Definition Classes
    MessageDispatcher
  8. def batchable(runnable: Runnable): Boolean

    Override this to define which runnables will be batched.

    Override this to define which runnables will be batched.

    Definition Classes
    BatchingExecutor
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. def createMailbox(actor: Cell): CallingThreadMailbox

    Creates and returns a mailbox for the given actor.

    Creates and returns a mailbox for the given actor.

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  11. final def detach(actor: ActorCell): Unit

    Detaches the specified actor instance from this dispatcher

    Detaches the specified actor instance from this dispatcher

    Definition Classes
    MessageDispatcher
  12. def dispatch(receiver: ActorCell, handle: Envelope): Unit

    Will be called when the dispatcher is to queue an invocation for execution

    Will be called when the dispatcher is to queue an invocation for execution

    INTERNAL API

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  15. def execute(runnable: Runnable): Unit

    Definition Classes
    BatchingExecutor → Executor
  16. def executeTask(invocation: TaskInvocation): Unit

    INTERNAL API

    INTERNAL API

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  17. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. def id: String

    Identifier of this dispatcher, corresponds to the full key of the dispatcher configuration.

    Identifier of this dispatcher, corresponds to the full key of the dispatcher configuration.

    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  21. final def inhabitants: Long

    Definition Classes
    MessageDispatcher
  22. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  23. final val isThroughputDeadlineTimeDefined: Boolean

    INTERNAL API

    INTERNAL API

    Attributes
    protected[akka]
    Definition Classes
    MessageDispatcher
  24. val log: LoggingAdapter

  25. val mailboxType: MailboxType

  26. val name: String

  27. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  30. def prepare(): ExecutionContext

    Definition Classes
    ExecutionContext
  31. val prerequisites: DispatcherPrerequisites

    Definition Classes
    MessageDispatcher
  32. def register(actor: ActorCell): Unit

    If you override it, you must call it.

    If you override it, you must call it. But only ever once. See "attach" for only invocation.

    INTERNAL API

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  33. def registerForExecution(mbox: Mailbox, hasMessageHint: Boolean, hasSystemMessageHint: Boolean): Boolean

    Suggest to register the provided mailbox for execution

    Suggest to register the provided mailbox for execution

    INTERNAL API

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  34. def reportFailure(t: Throwable): Unit

    Definition Classes
    MessageDispatcher → ExecutionContext
  35. def resume(actor: ActorCell): Unit

  36. def shutdown(): Unit

    Called one time every time an actor is detached from this dispatcher and this dispatcher has no actors left attached Must be idempotent

    Called one time every time an actor is detached from this dispatcher and this dispatcher has no actors left attached Must be idempotent

    INTERNAL API

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  37. def shutdownTimeout: FiniteDuration

    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.

    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

    INTERNAL API

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  38. def suspend(actor: ActorCell): Unit

    After the call to this method, the dispatcher mustn't begin any new message processing for the specified reference

    After the call to this method, the dispatcher mustn't begin any new message processing for the specified reference

    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  39. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  40. def systemDispatch(receiver: ActorCell, message: SystemMessage): Unit

    Will be called when the dispatcher is to queue an invocation for execution

    Will be called when the dispatcher is to queue an invocation for execution

    INTERNAL API

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  41. def throughput: Int

    INTERNAL API

    INTERNAL API

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  42. def throughputDeadlineTime: FiniteDuration

    INTERNAL API

    INTERNAL API

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  43. def toString(): String

    Definition Classes
    AnyRef → Any
  44. final def unbatchedExecute(r: Runnable): Unit

    Attributes
    protected
    Definition Classes
    MessageDispatcher → BatchingExecutor
  45. def unregister(actor: ActorCell): Unit

    If you override it, you must call it.

    If you override it, you must call it. But only ever once. See "detach" for the only invocation

    INTERNAL API

    Attributes
    protected[akka]
    Definition Classes
    MessageDispatcher
  46. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  47. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  48. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from MessageDispatcher

Inherited from ExecutionContext

Inherited from BatchingExecutor

Inherited from Executor

Inherited from AbstractMessageDispatcher

Inherited from AnyRef

Inherited from Any

Ungrouped