Search Results for

    Show / Hide Table of Contents

    Class ShardedDaemonProcess

    This extension runs a pre-set number of actors in a cluster.

    The typical use case is when you have a task that can be divided in a number of workers, each doing a sharded part of the work, for example consuming the read side events from Akka Persistence through tagged events where each tag decides which consumer that should consume the event.

    Each named set needs to be started on all the nodes of the cluster on start up.

    The processes are spread out across the cluster, when the cluster topology changes the processes may be stopped and started anew on a new node to rebalance them.

    Not for user extension.

    Inheritance
    object
    ShardedDaemonProcess
    Implements
    IExtension
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Cluster.Sharding
    Assembly: Akka.Cluster.Sharding.dll
    Syntax
    public class ShardedDaemonProcess : IExtension

    Constructors

    | Edit this page View Source

    ShardedDaemonProcess(ExtendedActorSystem)

    Declaration
    public ShardedDaemonProcess(ExtendedActorSystem system)
    Parameters
    Type Name Description
    ExtendedActorSystem system

    Methods

    | Edit this page View Source

    Get(ActorSystem)

    Declaration
    public static ShardedDaemonProcess Get(ActorSystem system)
    Parameters
    Type Name Description
    ActorSystem system
    Returns
    Type Description
    ShardedDaemonProcess
    | Edit this page View Source

    Init(string, int, Func<int, Props>)

    Start a specific number of actors that is then kept alive in the cluster.

    Declaration
    public IActorRef? Init(string name, int numberOfInstances, Func<int, Props> propsFactory)
    Parameters
    Type Name Description
    string name

    TBD

    int numberOfInstances

    TBD

    Func<int, Props> propsFactory

    Given a unique id of 0 until numberOfInstance create an entity actor.

    Returns
    Type Description
    IActorRef

    A reference to a router actor that will distribute all messages evenly across the workers using round-robin message routing. null if the ShardedDaemonProcess is misconfigured.

    | Edit this page View Source

    Init(string, int, Func<int, Props>, ShardedDaemonProcessSettings, object?)

    Start a specific number of actors, each with a unique numeric id in the set, that is then kept alive in the cluster.

    Declaration
    public IActorRef? Init(string name, int numberOfInstances, Func<int, Props> propsFactory, ShardedDaemonProcessSettings settings, object? stopMessage)
    Parameters
    Type Name Description
    string name

    The name of this sharded daemon set

    int numberOfInstances

    The number of instances to run

    Func<int, Props> propsFactory

    Given a unique id of 0 until numberOfInstance create an entity actor.

    ShardedDaemonProcessSettings settings

    The settings for configuring this sharded daemon process.

    object stopMessage

    If defined sent to the actors when they need to stop because of a rebalance across the nodes of the cluster or cluster shutdown.

    Returns
    Type Description
    IActorRef

    A reference to a router actor that will distribute all messages evenly across the workers using round-robin message routing. null if the ShardedDaemonProcess is misconfigured.

    | Edit this page View Source

    Init(string, int, Func<int, Props>, object?)

    Start a specific number of actors that is then kept alive in the cluster.

    Declaration
    public IActorRef? Init(string name, int numberOfInstances, Func<int, Props> propsFactory, object? stopMessage)
    Parameters
    Type Name Description
    string name

    The name of this sharded daemon set

    int numberOfInstances

    The number of instances to run

    Func<int, Props> propsFactory

    Given a unique id of 0 until numberOfInstance create an entity actor.

    object stopMessage

    Sent to the actors when they need to stop because of a rebalance across the nodes of the cluster or cluster shutdown.

    Returns
    Type Description
    IActorRef

    A reference to a router actor that will distribute all messages evenly across the workers using round-robin message routing. null if the ShardedDaemonProcess is misconfigured.

    | Edit this page View Source

    InitProxy(string, int, string)

    Starts a proxy for a sharded daemon process running in a different role.

    Declaration
    public IActorRef InitProxy(string name, int numberOfInstances, string role)
    Parameters
    Type Name Description
    string name

    The name of this daemon worker set

    int numberOfInstances

    The number of instances that belong on this set - note that this value must match the value used in the Init call on the hosting-nodes or messages may be lost.

    string role

    The role where the worker actors are hosted.

    Returns
    Type Description
    IActorRef

    A reference to a router actor that will distribute all messages evenly across the workers using round-robin message routing.

    Implements

    IExtension

    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