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, Executor, AbstractMessageDispatcher, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. CallingThreadDispatcher
  2. MessageDispatcher
  3. ExecutionContext
  4. Executor
  5. AbstractMessageDispatcher
  6. AnyRef
  7. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CallingThreadDispatcher (_prerequisites: DispatcherPrerequisites, mailboxType: MailboxType, name: String)

Value Members

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

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

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

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

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

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

    Attributes
    final
    Definition Classes
    Any
  7. 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).

    Attributes
    final
    Definition Classes
    MessageDispatcher
  8. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. def createMailbox (actor: ActorCell): 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
  10. def detach (actor: ActorCell): Unit

    Detaches the specified actor instance from this dispatcher

    Detaches the specified actor instance from this dispatcher

    Attributes
    final
    Definition Classes
    MessageDispatcher
  11. 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

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

    Attributes
    final
    Definition Classes
    AnyRef
  13. def equals (arg0: Any): Boolean

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

    Submits the runnable for execution

    Submits the runnable for execution

    Attributes
    final
    Definition Classes
    MessageDispatcherExecutionContext → Executor
  15. def executeTask (invocation: TaskInvocation): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef → Any
  18. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  19. 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
  20. def inhabitants : Long

    Definition Classes
    MessageDispatcher
  21. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  22. val isThroughputDeadlineTimeDefined : Boolean

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

  24. val mailboxType : MailboxType

  25. val name : String

  26. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  27. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  28. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  29. val prerequisites : DispatcherPrerequisites

    Definition Classes
    MessageDispatcher
  30. 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.

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  31. 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

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

    Failed tasks should call reportFailure to let the ExecutionContext log the problem or whatever is appropriate for the implementation.

    Failed tasks should call reportFailure to let the ExecutionContext log the problem or whatever is appropriate for the implementation.

    Definition Classes
    MessageDispatcherExecutionContext
  33. def resume (actor: ActorCell): Unit

  34. 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

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  35. 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

    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  36. 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
  37. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  38. 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

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

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

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

    Definition Classes
    AnyRef → Any
  42. 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

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

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from MessageDispatcher

Inherited from ExecutionContext

Inherited from Executor

Inherited from AbstractMessageDispatcher

Inherited from AnyRef

Inherited from Any