Class/Object

akka.testkit

CallingThreadDispatcher

Related Docs: object CallingThreadDispatcher | package testkit

Permalink

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.

Source
CallingThreadDispatcher.scala
Since

1.1

Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CallingThreadDispatcher
  2. MessageDispatcher
  3. ExecutionContextExecutor
  4. ExecutionContext
  5. BatchingExecutor
  6. Executor
  7. AbstractMessageDispatcher
  8. AnyRef
  9. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CallingThreadDispatcher(_configurator: MessageDispatcherConfigurator)

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from CallingThreadDispatcher to any2stringadd[CallingThreadDispatcher] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (CallingThreadDispatcher, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from CallingThreadDispatcher to ArrowAssoc[CallingThreadDispatcher] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

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

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

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

    Permalink
    Definition Classes
    BatchingExecutor
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. val configurator: MessageDispatcherConfigurator

    Permalink
    Definition Classes
    MessageDispatcher
  11. def createMailbox(actor: Cell, mailboxType: MailboxType): CallingThreadMailbox

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  12. final def detach(actor: ActorCell): Unit

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

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  14. def ensuring(cond: (CallingThreadDispatcher) ⇒ Boolean, msg: ⇒ Any): CallingThreadDispatcher

    Permalink
    Implicit information
    This member is added by an implicit conversion from CallingThreadDispatcher to Ensuring[CallingThreadDispatcher] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: (CallingThreadDispatcher) ⇒ Boolean): CallingThreadDispatcher

    Permalink
    Implicit information
    This member is added by an implicit conversion from CallingThreadDispatcher to Ensuring[CallingThreadDispatcher] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean, msg: ⇒ Any): CallingThreadDispatcher

    Permalink
    Implicit information
    This member is added by an implicit conversion from CallingThreadDispatcher to Ensuring[CallingThreadDispatcher] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: Boolean): CallingThreadDispatcher

    Permalink
    Implicit information
    This member is added by an implicit conversion from CallingThreadDispatcher to Ensuring[CallingThreadDispatcher] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  20. val eventStream: EventStream

    Permalink
    Definition Classes
    MessageDispatcher
  21. def execute(runnable: Runnable): Unit

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

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from CallingThreadDispatcher to StringFormat[CallingThreadDispatcher] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  25. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  27. def id: String

    Permalink
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  28. final def inhabitants: Long

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

    Permalink
    Definition Classes
    Any
  30. final val isThroughputDeadlineTimeDefined: Boolean

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

    Permalink
  32. val mailboxes: Mailboxes

    Permalink
    Definition Classes
    MessageDispatcher
  33. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  34. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  36. def prepare(): ExecutionContext

    Permalink
    Definition Classes
    ExecutionContext
  37. def register(actor: ActorCell): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  38. def registerForExecution(mbox: Mailbox, hasMessageHint: Boolean, hasSystemMessageHint: Boolean): Boolean

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  39. def reportFailure(t: Throwable): Unit

    Permalink
    Definition Classes
    MessageDispatcher → ExecutionContext
  40. final def resubmitOnBlock: Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    MessageDispatcher → BatchingExecutor
  41. def resume(actor: ActorCell): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  42. def shutdown(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  43. def shutdownTimeout: FiniteDuration

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  44. def suspend(actor: ActorCell): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  45. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  47. def throughput: Int

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  48. def throughputDeadlineTime: FiniteDuration

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  49. def toString(): String

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

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

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    CallingThreadDispatcher → MessageDispatcher
  52. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. def [B](y: B): (CallingThreadDispatcher, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from CallingThreadDispatcher to ArrowAssoc[CallingThreadDispatcher] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from MessageDispatcher

Inherited from ExecutionContextExecutor

Inherited from ExecutionContext

Inherited from BatchingExecutor

Inherited from Executor

Inherited from AbstractMessageDispatcher

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from CallingThreadDispatcher to any2stringadd[CallingThreadDispatcher]

Inherited by implicit conversion StringFormat from CallingThreadDispatcher to StringFormat[CallingThreadDispatcher]

Inherited by implicit conversion Ensuring from CallingThreadDispatcher to Ensuring[CallingThreadDispatcher]

Inherited by implicit conversion ArrowAssoc from CallingThreadDispatcher to ArrowAssoc[CallingThreadDispatcher]

Ungrouped