You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* stashing work
* finished first pass at push-based `ShardedDaemonProcess`
close#7195
* fixed issues with message propagation
* made `ShardedDaemonProcessSettings` support `nullable`
* cleanup logging
* added standard function for name formatting
* Fix unit test
* added documentation
---------
Co-authored-by: Gregorius Soedharmo <[email protected]>
Copy file name to clipboardExpand all lines: docs/articles/clustering/cluster-sharded-daemon-process.md
+17-2
Original file line number
Diff line number
Diff line change
@@ -32,5 +32,20 @@ when starting up:
32
32
33
33
## Scalability
34
34
35
-
This cluster tool is intended for small numbers of consumers and will not scale well to a large set. In large clusters
36
-
it is recommended to limit the nodes the sharded daemon process will run on using a role.
35
+
This cluster tool is intended for small numbers of consumers and will not scale well to a large set. In large clusters it is recommended to limit the nodes the sharded daemon process will run on using a role.
36
+
37
+
## Push-Based Communication
38
+
39
+
[`ShardedDaemonProcess`](xref:Akka.Cluster.Sharding.ShardedDaemonProcess) also supports push-based communication not too dissimilar from a round-robin `Router`:
40
+
41
+
[!code-csharp[IActorRef returned by ShardedDaemonProcess](../../../src/contrib/cluster/Akka.Cluster.Sharding.Tests/ShardedDaemonProcessProxySpec.cs?name=PushDaemon)]
42
+
43
+
The `ShardedDaemonProcess.Init` call returns an `IActorRef` - any messages you send to this `IActorRef` will be routed to one of the `n` worker instances you specified.
44
+
45
+
## Daemon Proxies
46
+
47
+
You can also interact with `ShardedDaemonProcess` on nodes that don't use the same [Akka.Cluster role](xref:member-roles) as the `ShardedDaemonProcess` host itself.
48
+
49
+
[!code-csharp[IActorRef returned by ShardedDaemonProcess](../../../src/contrib/cluster/Akka.Cluster.Sharding.Tests/ShardedDaemonProcessProxySpec.cs?name=PushDaemonProxy)]
50
+
51
+
Under the covers we use a [`ShardRegionProxy`](xref:Akka.Cluster.Sharding.ClusterSharding#Akka_Cluster_Sharding_ClusterSharding_StartProxy_System_String_System_String_Akka_Cluster_Sharding_IMessageExtractor_) to forward any messages you send to the `IActorRef` returned by the `ShardedDaemonProcess.InitProxy` method.
0 commit comments