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
Attaches the specified actorRef to this dispatcher
Attaches the specified actorRef to this dispatcher
Creates and returns a mailbox for the given actor.
Creates and returns a mailbox for the given actor.
Detaches the specified actorRef from this dispatcher
Detaches the specified actorRef from this dispatcher
the mailbox associated with the actor
Returns the size of the mailbox for the specified actor
Returns the size of the mailbox for the specified actor
Returns the amount of futures queued for execution
Returns the amount of futures queued for execution
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
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
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
Default settings are:
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) .buildThreadPoolJava 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.