Class Dispatchers
The registry of all MessageDispatcher instances available to this ActorSystem.
Dispatchers are to be defined in configuration to allow for tuning for different environments. Use the Lookup(string) method to create a dispatcher as specified in configuration.
A dispatcher config can also be an alias, in that case it is a config string value pointing to the actual dispatcher config.
Look in akka.actor.default-dispatcher section of the reference.conf
for documentation of dispatcher options.
Not for user instantiation or extension
Inherited Members
Namespace: Akka.Dispatch
Assembly: Akka.dll
Syntax
public sealed class Dispatchers
Constructors
| Edit this page View SourceDispatchers(ActorSystem, IDispatcherPrerequisites, ILoggingAdapter)
Initializes a new instance of the Dispatchers class.
Declaration
public Dispatchers(ActorSystem system, IDispatcherPrerequisites prerequisites, ILoggingAdapter logger)
Parameters
| Type | Name | Description |
|---|---|---|
| ActorSystem | system | The system. |
| IDispatcherPrerequisites | prerequisites | The prerequisites required for some MessageDispatcherConfigurator instances. |
| ILoggingAdapter | logger | The logger for dispatchers. |
Fields
| Edit this page View SourceDefaultBlockingDispatcherId
The id of a default dispatcher to use for operations known to be blocking. Note that for optimal performance you will want to isolate different blocking resources on different thread pools.
Declaration
public const string DefaultBlockingDispatcherId = "akka.actor.default-blocking-io-dispatcher"
Field Value
| Type | Description |
|---|---|
| string |
DefaultDispatcherId
The default dispatcher identifier, also the full key of the configuration of the default dispatcher.
Declaration
public const string DefaultDispatcherId = "akka.actor.default-dispatcher"
Field Value
| Type | Description |
|---|---|
| string |
SynchronizedDispatcherId
The identifier for synchronized dispatchers.
Declaration
public const string SynchronizedDispatcherId = "akka.actor.synchronized-dispatcher"
Field Value
| Type | Description |
|---|---|
| string |
Properties
| Edit this page View SourceDefaultDispatcherConfig
The Config for the default dispatcher.
Declaration
public Config DefaultDispatcherConfig { get; }
Property Value
| Type | Description |
|---|---|
| Config |
DefaultGlobalDispatcher
Gets the one and only default dispatcher.
Declaration
public MessageDispatcher DefaultGlobalDispatcher { get; }
Property Value
| Type | Description |
|---|---|
| MessageDispatcher |
Prerequisites
The prerequisites required for some MessageDispatcherConfigurator instances.
Declaration
public IDispatcherPrerequisites Prerequisites { get; }
Property Value
| Type | Description |
|---|---|
| IDispatcherPrerequisites |
Methods
| Edit this page View SourceHasDispatcher(string)
Checks that configuration provides a section for the given dispatcher. This does not guarantee that no ConfigurationException will be thrown when using the dispatcher, because the details can only be checked by trying to instantiate it, which might be undesirable when just checking.
Declaration
public bool HasDispatcher(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | TBD |
Returns
| Type | Description |
|---|---|
| bool |
Lookup(string)
Returns a dispatcher as specified in configuration. Please note that this
method may create and return a NEW dispatcher, every call (depending on the MessageDispatcherConfigurator
dispatcher config the id points to).
A dispatcher id can also be an alias. In the case it is a string value in the config it is treated as the id of the actual dispatcher config to use. If several ids leading to the same actual dispatcher config is used only one instance is created. This means that for dispatchers you expect to be shared they will be.
Declaration
public MessageDispatcher Lookup(string dispatcherName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | dispatcherName | TBD |
Returns
| Type | Description |
|---|---|
| MessageDispatcher | TBD |
Exceptions
| Type | Condition |
|---|---|
| ConfigurationException | This exception is thrown if the specified dispatcher cannot be found in the configuration. |
RegisterConfigurator(string, MessageDispatcherConfigurator)
Register a MessageDispatcherConfigurator that will be used by Lookup(string) and HasDispatcher(string) instead of looking up the configurator from the system configuration.
This enables dynamic addition of dispatchers.
Declaration
public bool RegisterConfigurator(string id, MessageDispatcherConfigurator configurator)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | TBD |
| MessageDispatcherConfigurator | configurator | TBD |
Returns
| Type | Description |
|---|---|
| bool | This method returns |
Edit this page