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.
Implements
Inherited Members
Namespace: Akka.Cluster.Sharding
Assembly: Akka.Cluster.Sharding.dll
Syntax
public class ShardedDaemonProcess : IExtension
Constructors
| Improve this Doc View SourceShardedDaemonProcess(ExtendedActorSystem)
Declaration
public ShardedDaemonProcess(ExtendedActorSystem system)
Parameters
Type | Name | Description |
---|---|---|
ExtendedActorSystem | system |
Methods
| Improve this Doc View SourceGet(ActorSystem)
Declaration
public static ShardedDaemonProcess Get(ActorSystem system)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system |
Returns
Type | Description |
---|---|
ShardedDaemonProcess |
Init(String, Int32, Func<Int32, Props>)
Start a specific number of actors that is then kept alive in the cluster.
Declaration
public void Init(string name, int numberOfInstances, Func<int, Props> propsFactory)
Parameters
Type | Name | Description |
---|---|---|
String | name | TBD |
Int32 | numberOfInstances | TBD |
Func<Int32, Props> | propsFactory | Given a unique id of |
Init(String, Int32, Func<Int32, 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 void Init(string name, int numberOfInstances, Func<int, Props> propsFactory, ShardedDaemonProcessSettings settings, object stopMessage)
Parameters
Type | Name | Description |
---|---|---|
String | name | TBD |
Int32 | numberOfInstances | TBD |
Func<Int32, Props> | propsFactory | Given a unique id of |
ShardedDaemonProcessSettings | settings | TBD |
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. |
Init(String, Int32, Func<Int32, Props>, Object)
Start a specific number of actors that is then kept alive in the cluster.
Declaration
public void Init(string name, int numberOfInstances, Func<int, Props> propsFactory, object stopMessage)
Parameters
Type | Name | Description |
---|---|---|
String | name | TBD |
Int32 | numberOfInstances | TBD |
Func<Int32, Props> | propsFactory | Given a unique id of |
Object | stopMessage | Sent to the actors when they need to stop because of a rebalance across the nodes of the cluster or cluster shutdown. |