akka.dispatch

ExecutorBasedEventDrivenDispatcher

class ExecutorBasedEventDrivenDispatcher extends MessageDispatcher

Default settings are:

  • withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity
  • NR_START_THREADS = 16
  • NR_MAX_THREADS = 128
  • KEEP_ALIVE_TIME = 60000L // one minute

The dispatcher has a fluent builder interface to build up a thread pool to suite your use-case. There is a default thread pool defined but make use of the builder if you need it. Here are some examples.

Scala API.

Example usage:

  val dispatcher = new ExecutorBasedEventDrivenDispatcher("name")
  dispatcher
    .withNewThreadPoolWithBoundedBlockingQueue(100)
    .setCorePoolSize(16)
    .setMaxPoolSize(128)
    .setKeepAliveTimeInMillis(60000)
    .setRejectionPolicy(new CallerRunsPolicy)
    .buildThreadPool

Java API.

Example usage:

  ExecutorBasedEventDrivenDispatcher dispatcher = new ExecutorBasedEventDrivenDispatcher("name");
  dispatcher
    .withNewThreadPoolWithBoundedBlockingQueue(100)
    .setCorePoolSize(16)
    .setMaxPoolSize(128)
    .setKeepAliveTimeInMillis(60000)
    .setRejectionPolicy(new CallerRunsPolicy())
    .buildThreadPool();

But the preferred way of creating dispatchers is to use the akka.dispatch.Dispatchers factory object.

Linear Supertypes
MessageDispatcher, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ExecutorBasedEventDrivenDispatcher
  2. MessageDispatcher
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ExecutorBasedEventDrivenDispatcher (_name: String)

  2. new ExecutorBasedEventDrivenDispatcher (_name: String, _config: ThreadPoolConfig)

  3. new ExecutorBasedEventDrivenDispatcher (_name: String, throughput: Int)

  4. new ExecutorBasedEventDrivenDispatcher (_name: String, throughput: Int, mailboxType: MailboxType)

  5. new ExecutorBasedEventDrivenDispatcher (_name: String, throughput: Int, throughputDeadlineTime: Int, mailboxType: MailboxType)

  6. new ExecutorBasedEventDrivenDispatcher (_name: String, throughput: Int, throughputDeadlineTime: Int, mailboxType: MailboxType, config: ThreadPoolConfig)

    throughput

    positive integer indicates the dispatcher will only process so much messages at a time from the mailbox, without checking the mailboxes of other actors. Zero or negative means the dispatcher always continues until the mailbox is empty. Larger values (or zero or negative) increase throughput, smaller values increase fairness

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. val config : ThreadPoolConfig

  11. def createMailbox (actorRef: ActorRef): AnyRef

    Creates and returns a mailbox for the given actor.

    Creates and returns a mailbox for the given actor.

    Definition Classes
    ExecutorBasedEventDrivenDispatcherMessageDispatcher
  12. def detach (actorRef: ActorRef): Unit

    Detaches the specified actorRef from this dispatcher

    Detaches the specified actorRef from this dispatcher

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

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

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

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

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

    Attributes
    final
    Definition Classes
    AnyRef
  18. def getMailbox (receiver: ActorRef): MessageQueue with ExecutableMailbox

    returns

    the mailbox associated with the actor

    Attributes
    protected
  19. val guard : ReentrantGuard

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

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

    Attributes
    final
    Definition Classes
    Any
  22. def mailboxSize (actorRef: ActorRef): Int

    Returns the size of the mailbox for the specified actor

    Returns the size of the mailbox for the specified actor

    Definition Classes
    ExecutorBasedEventDrivenDispatcherMessageDispatcher
  23. val mailboxType : MailboxType

  24. val name : String

  25. def ne (arg0: AnyRef): Boolean

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

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

    Attributes
    final
    Definition Classes
    AnyRef
  28. def pendingFutures : Long

    Returns the amount of futures queued for execution

    Returns the amount of futures queued for execution

    Definition Classes
    MessageDispatcher
  29. def resume (actorRef: ActorRef): Unit

  30. 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
  31. def suspend (actorRef: 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
    ExecutorBasedEventDrivenDispatcherMessageDispatcher
  32. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  33. val throughput : Int

    positive integer indicates the dispatcher will only process so much messages at a time from the mailbox, without checking the mailboxes of other actors.

    positive integer indicates the dispatcher will only process so much messages at a time from the mailbox, without checking the mailboxes of other actors. Zero or negative means the dispatcher always continues until the mailbox is empty. Larger values (or zero or negative) increase throughput, smaller values increase fairness

  34. val throughputDeadlineTime : Int

  35. val toString : String

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

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

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from MessageDispatcher

Inherited from AnyRef

Inherited from Any