Configurator for creating akka.dispatch.BalancingDispatcher.
Configurator for creating akka.dispatch.BalancingDispatcher.
Returns the same dispatcher instance for for each invocation
of the dispatcher()
method.
BoundedDequeBasedMailbox is an bounded MailboxType, backed by a Deque.
BoundedMessageQueueSemantics adds bounded semantics to a DequeBasedMessageQueue, i.e.
BoundedMessageQueueSemantics adds bounded semantics to a DequeBasedMessageQueue, i.e. blocking enqueue with timeout.
BoundedMailbox is the default bounded MailboxType used by Akka Actors.
BoundedMessageQueueSemantics adds bounded semantics to a QueueBasedMessageQueue, i.e.
BoundedMessageQueueSemantics adds bounded semantics to a QueueBasedMessageQueue, i.e. blocking enqueue with timeout.
BoundedPriorityMailbox is a bounded mailbox that allows for prioritization of its contents.
BoundedPriorityMailbox is a bounded mailbox that allows for prioritization of its contents. Extend this class and provide the Comparator in the constructor.
DequeBasedMessageQueue refines QueueBasedMessageQueue to be backed by a java.util.Deque.
The event-based
binds a set of Actors to a thread pool backed up by a
Dispatcher
BlockingQueue
.
The event-based
binds a set of Actors to a thread pool backed up by a
Dispatcher
BlockingQueue
.
The preferred way of creating dispatchers is to define configuration of it and use the
the lookup
method in akka.dispatch.Dispatchers.
Configurator for creating akka.dispatch.Dispatcher.
Configurator for creating akka.dispatch.Dispatcher.
Returns the same dispatcher instance for for each invocation
of the dispatcher()
method.
DispatcherPrerequisites represents useful contextual pieces when constructing a MessageDispatcher
Dispatchers are to be defined in configuration to allow for tuning for different environments.
Dispatchers are to be defined in configuration to allow for tuning
for different environments. Use the lookup
method to create
a dispatcher as specified in configuration.
Look in akka.actor.default-dispatcher
section of the reference.conf
for documentation of dispatcher options.
An ExecutorServiceConfigurator is a class that given some prerequisites and a configuration can create instances of ExecutorService
As the name says
Function0 without the fun stuff (mostly for the sake of the Java API side of things)
Generic way to specify an ExecutorService to a Dispatcher, create it with the given name if desired
Callback for the Future.foreach operation that will be invoked if the Future that this callback is registered on becomes completed with a success.
Callback for the Future.foreach operation that will be invoked if the Future that this callback is registered on becomes completed with a success. This method is essentially the same operation as onSuccess.
SAM (Single Abstract Method) class Java API
MailboxType is a factory to create MessageQueues for an optionally provided ActorContext.
MailboxType is a factory to create MessageQueues for an optionally provided ActorContext.
Possibly Important Notice
When implementing a custom mailbox type, be aware that there is special
semantics attached to system.actorOf()
in that sending to the returned
ActorRef may—for a short period of time—enqueue the messages first in a
dummy queue. Top-level actors are created in two steps, and only after the
guardian actor has performed that second step will all previously sent
messages be transferred from the dummy queue into the real mailbox.
Callback for the Future.map and Future.flatMap operations that will be invoked if the Future that this callback is registered on becomes completed with a success.
Callback for the Future.map and Future.flatMap operations that will be invoked if the Future that this callback is registered on becomes completed with a success. This callback is the equivalent of an akka.japi.Function
Override "apply" normally, or "checkedApply" if you need to throw checked exceptions.
SAM (Single Abstract Method) class
Java API
Base class to be used for hooking in new dispatchers into Dispatchers.
A MessageQueue is one of the core components in forming an Akka Mailbox.
A MessageQueue is one of the core components in forming an Akka Mailbox. The MessageQueue is where the normal messages that are sent to Actors will be enqueued (and subsequently dequeued) It needs to at least support N producers and 1 consumer thread-safely.
This is a marker trait for message queues which support multiple consumers, as is required by the BalancingDispatcher.
Callback for when a Future is completed with either failure or a success SAM (Single Abstract Method) class
Callback for when a Future is completed with either failure or a success SAM (Single Abstract Method) class
Java API
Callback for when a Future is completed with a failure SAM (Single Abstract Method) class
Callback for when a Future is completed with a failure SAM (Single Abstract Method) class
Java API
Callback for when a Future is completed successfully SAM (Single Abstract Method) class
Callback for when a Future is completed successfully SAM (Single Abstract Method) class
Java API
Dedicates a unique thread for each actor passed in as reference.
Dedicates a unique thread for each actor passed in as reference. Served through its messageQueue.
The preferred way of creating dispatchers is to define configuration of it and use the
the lookup
method in akka.dispatch.Dispatchers.
Configurator for creating akka.dispatch.PinnedDispatcher.
Configurator for creating akka.dispatch.PinnedDispatcher.
Returns new dispatcher instance for for each invocation
of the dispatcher()
method.
A PriorityGenerator is a convenience API to create a Comparator that orders the messages of a PriorityDispatcher
A QueueBasedMessageQueue is a MessageQueue backed by a java.util.Queue.
Callback for the Future.recover operation that conditionally turns failures into successes.
Callback for the Future.recover operation that conditionally turns failures into successes.
SAM (Single Abstract Method) class
Java API
Trait to signal that an Actor requires a certain type of message queue semantics.
Trait to signal that an Actor requires a certain type of message queue semantics.
The mailbox type will be looked up by mapping the type T via akka.actor.mailbox.requirements in the config, to a mailbox configuration. If no mailbox is assigned on Props or in deployment config then this one will be used.
The queue type of the created mailbox will be checked against the type T and actor creation will fail if it doesn't fulfill the requirements.
The RejectedExecutionHandler used by Akka, it improves on CallerRunsPolicy by throwing a RejectedExecutionException if the executor isShutdown.
The RejectedExecutionHandler used by Akka, it improves on CallerRunsPolicy by throwing a RejectedExecutionException if the executor isShutdown. (CallerRunsPolicy silently discards the runnable in this case, which is arguably broken)
SingleConsumerOnlyUnboundedMailbox is a high-performance, multiple producer—single consumer, unbounded MailboxType, with the drawback that you can't have multiple consumers, which rules out using it with BalancingPool (BalancingDispatcher) for instance.
SingleConsumerOnlyUnboundedMailbox is a high-performance, multiple producer—single consumer, unbounded MailboxType, with the drawback that you can't have multiple consumers, which rules out using it with BalancingPool (BalancingDispatcher) for instance.
Currently this queue is slower for some benchmarks than the ConcurrentLinkedQueue from JDK 8 that is used by default, so be sure to measure the performance in your particular setting in order to determine which one to use.
A small configuration DSL to create ThreadPoolExecutors that can be provided as an ExecutorServiceFactoryProvider to Dispatcher
A DSL to configure and create a MessageDispatcher with a ThreadPoolExecutor
UnboundedDequeBasedMailbox is an unbounded MailboxType, backed by a Deque.
UnboundedDequeBasedMessageQueueSemantics adds unbounded semantics to a DequeBasedMessageQueue, i.e.
UnboundedDequeBasedMessageQueueSemantics adds unbounded semantics to a DequeBasedMessageQueue, i.e. a non-blocking enqueue and dequeue.
UnboundedMailbox is the default unbounded MailboxType used by Akka Actors.
UnboundedMessageQueueSemantics adds unbounded semantics to a QueueBasedMessageQueue, i.e.
UnboundedMessageQueueSemantics adds unbounded semantics to a QueueBasedMessageQueue, i.e. a non-blocking enqueue and dequeue.
UnboundedPriorityMailbox is an unbounded mailbox that allows for prioritization of its contents.
UnboundedPriorityMailbox is an unbounded mailbox that allows for prioritization of its contents. Extend this class and provide the Comparator in the constructor.
An executor based event driven dispatcher which will try to redistribute work from busy actors to idle actors.
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 akka.dispatch.Dispatchers.
(Since version 2.3) Use BalancingPool instead of BalancingDispatcher
akka.dispatch.Dispatchers
akka.dispatch.BalancingDispatcher
ExecutionContexts is the Java API for ExecutionContexts
Java API (not recommended): Callback for the Future.filter operation that creates a new Future which will conditionally contain the success of another Future.
Java API (not recommended): Callback for the Future.filter operation that creates a new Future which will conditionally contain the success of another Future.
Unfortunately it is not possible to express the type of a Scala filter in
Java: Function1[T, Boolean], where “Boolean” is the primitive type. It is
possible to use Future.filter
by constructing such a function indirectly:
import static akka.dispatch.Filter.filterOf; Future<String> f = ...; f.filter(filterOf(new Function<String, Boolean>() { @Override public Boolean apply(String s) { ... } }));
However, Future.filter
exists mainly to support Scala’s for-comprehensions,
thus Java users should prefer Future.map
, translating non-matching values
to failure cases.
Futures is the Java API for Futures and Promises
This class contains bridge classes between Scala and Java.
This class contains bridge classes between Scala and Java. Internal use only.