akka.dispatch

BalancingDispatcher

class BalancingDispatcher extends Dispatcher

An executor based event driven dispatcher which will try to redistribute work from busy actors to idle actors. It is assumed that all actors using the same instance of this dispatcher can process all messages that have been sent to one of the actors. I.e. the actors belong to a pool of actors, and to the client there is no guarantee about which actor instance actually processes a given message.

Although the technique used in this implementation is commonly known as "work stealing", the actual implementation is probably best described as "work donating" because the actor of which work is being stolen takes the initiative.

The preferred way of creating dispatchers is to define configuration of it and use the the lookup method in Dispatchers.

See also

akka.dispatch.Dispatchers

,

akka.dispatch.BalancingDispatcher

Linear Supertypes
Dispatcher, MessageDispatcher, ExecutionContext, Executor, AbstractMessageDispatcher, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. BalancingDispatcher
  2. Dispatcher
  3. MessageDispatcher
  4. ExecutionContext
  5. Executor
  6. AbstractMessageDispatcher
  7. AnyRef
  8. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BalancingDispatcher(_prerequisites: DispatcherPrerequisites, _id: String, throughput: Int, throughputDeadlineTime: Duration, mailboxType: MailboxType, _executorServiceFactoryProvider: ExecutorServiceFactoryProvider, _shutdownTimeout: Duration, attemptTeamWork: Boolean)

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 clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. def createMailbox(actor: ActorCell): Mailbox

    Creates and returns a mailbox for the given actor.

    Creates and returns a mailbox for the given actor.

    Attributes
    protected[akka]
    Definition Classes
    BalancingDispatcherDispatcherMessageDispatcher
  10. 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
  11. def dispatch(receiver: ActorCell, invocation: 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
    BalancingDispatcherDispatcherMessageDispatcher
  12. final def eq(arg0: AnyRef): Boolean

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

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

    Submits the runnable for execution

    Submits the runnable for execution

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

    Attributes
    protected[akka]
    Definition Classes
    DispatcherMessageDispatcher
  16. val executorService: AtomicReference[ExecutorServiceDelegate]

    Attributes
    protected
    Definition Classes
    Dispatcher
  17. val executorServiceFactory: ExecutorServiceFactory

    Attributes
    protected
    Definition Classes
    Dispatcher
  18. def finalize(): Unit

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

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

    Definition Classes
    AnyRef → Any
  21. val 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
    DispatcherMessageDispatcher
  22. def inhabitants: Long

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

    Definition Classes
    Any
  24. final val isThroughputDeadlineTimeDefined: Boolean

    Attributes
    protected[akka]
    Definition Classes
    MessageDispatcher
  25. val messageQueue: MessageQueue

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

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

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

    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
    BalancingDispatcherMessageDispatcher
  31. def registerForExecution(mbox: Mailbox, hasMessageHint: Boolean, hasSystemMessageHint: Boolean): Boolean

    Returns if it was registered

    Returns if it was registered

    Attributes
    protected[akka]
    Definition Classes
    DispatcherMessageDispatcher
  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

    Definition Classes
    MessageDispatcher
  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
    DispatcherMessageDispatcher
  35. val shutdownTimeout: Duration

    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

    Definition Classes
    DispatcherMessageDispatcher
  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
    MessageDispatcher
  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  38. def systemDispatch(receiver: ActorCell, invocation: 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
    DispatcherMessageDispatcher
  39. def teamWork(): Unit

    Attributes
    protected
  40. val toString: String

    Definition Classes
    Dispatcher → AnyRef → Any
  41. 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
    BalancingDispatcherMessageDispatcher
  42. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. val team: ConcurrentSkipListSet[ActorCell]

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.2) Will become private[akka] in 2.1, this is not user-api

Inherited from Dispatcher

Inherited from MessageDispatcher

Inherited from ExecutionContext

Inherited from Executor

Inherited from AbstractMessageDispatcher

Inherited from AnyRef

Inherited from Any