Search Results for

    Show / Hide Table of Contents

    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

    Inheritance
    object
    Dispatchers
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Dispatch
    Assembly: Akka.dll
    Syntax
    public sealed class Dispatchers

    Constructors

    | Edit this page View Source

    Dispatchers(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 Source

    DefaultBlockingDispatcherId

    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
    | Edit this page View Source

    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
    | Edit this page View Source

    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 Source

    DefaultDispatcherConfig

    The Config for the default dispatcher.

    Declaration
    public Config DefaultDispatcherConfig { get; }
    Property Value
    Type Description
    Config
    | Edit this page View Source

    DefaultGlobalDispatcher

    Gets the one and only default dispatcher.

    Declaration
    public MessageDispatcher DefaultGlobalDispatcher { get; }
    Property Value
    Type Description
    MessageDispatcher
    | Edit this page View Source

    Prerequisites

    The prerequisites required for some MessageDispatcherConfigurator instances.

    Declaration
    public IDispatcherPrerequisites Prerequisites { get; }
    Property Value
    Type Description
    IDispatcherPrerequisites

    Methods

    | Edit this page View Source

    HasDispatcher(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
    | Edit this page View Source

    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.

    | Edit this page View Source

    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.

    A MessageDispatcherConfigurator for a certain id can only be registered once, i.e. it can not be replaced. It is safe to call this method multiple times, but only the first registration will be used.
    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 true if the specified configurator was successfully registered.

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET