From 0d64ac3cd78ec60b0906bad86970ee2f7c2cff71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Thu, 28 Jan 2021 10:35:23 +0100 Subject: [PATCH] Add a note about shard actor factory being local (#29970) --- akka-docs/src/main/paradox/typed/cluster-sharding.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/akka-docs/src/main/paradox/typed/cluster-sharding.md b/akka-docs/src/main/paradox/typed/cluster-sharding.md index 62e1e7015c..108f7d830b 100644 --- a/akka-docs/src/main/paradox/typed/cluster-sharding.md +++ b/akka-docs/src/main/paradox/typed/cluster-sharding.md @@ -97,6 +97,8 @@ Cluster sharding `init` should be called on every node for each entity type. Whi can be controlled with @ref:[roles](cluster.md#node-roles). `init` will create a `ShardRegion` or a proxy depending on whether the node's role matches the entity's role. +The behavior factory lambda passed to the init method is defined on each node and only used locally, this means it is safe to use it for injecting for example a node local `ActorRef` that each sharded actor should have access to or some object that is not possible to serialize. + Specifying the role: Scala