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

Instance Constructors

  1. new CallingThreadDispatcher (warnings: Boolean)

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. val active : Switch

    Attributes
    protected
    Definition Classes
    MessageDispatcher
  7. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  8. def attach (actorRef: ActorRef): Unit

    Attaches the specified actorRef to this dispatcher

    Attaches the specified actorRef to this dispatcher

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. def detach (actorRef: ActorRef): Unit

    Detaches the specified actorRef from this dispatcher

    Detaches the specified actorRef from this dispatcher

    Attributes
    final
    Definition Classes
    MessageDispatcher
  11. def eq (arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  13. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. val futures : AtomicLong

    Attributes
    protected
    Definition Classes
    MessageDispatcher
  15. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef
  16. val guard : ReentrantGuard

    Attributes
    protected
    Definition Classes
    MessageDispatcher
  17. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  18. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  19. def mailboxSize (actor: ActorRef): Int

    Returns the size of the mailbox for the specified actor

    Returns the size of the mailbox for the specified actor

    Definition Classes
    CallingThreadDispatcherMessageDispatcher
  20. def ne (arg0: AnyRef): Boolean

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

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

    Attributes
    final
    Definition Classes
    AnyRef
  23. def pendingFutures : Long

    Returns the amount of futures queued for execution

    Returns the amount of futures queued for execution

    Definition Classes
    MessageDispatcher
  24. def resume (actor: ActorRef): Unit

  25. def stopAllAttachedActors : Unit

    Traverses the list of actors (uuids) currently being attached to this dispatcher and stops those actors

    Traverses the list of actors (uuids) currently being attached to this dispatcher and stops those actors

    Definition Classes
    MessageDispatcher
  26. def suspend (actor: ActorRef): 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
  27. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  28. def toString (): String

    Definition Classes
    AnyRef → Any
  29. val uuids : ConcurrentSkipListSet[Uuid]

    Attributes
    protected
    Definition Classes
    MessageDispatcher
  30. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  33. val warnings : Boolean

Inherited from MessageDispatcher

Inherited from AnyRef

Inherited from Any