ClusterSharding
Defined in: src/cluster/sharding/ClusterSharding.ts:75
User-facing entry point. Attaches to an ActorSystem + Cluster pair and
lets you start a sharded region for each entity type. A ShardCoordinator
is spawned lazily on every node; only the one hosted by the current
cluster leader is active — the rest act as warm standbys.
Properties
Section titled “Properties”cluster
Section titled “cluster”
readonlycluster:Cluster
Defined in: src/cluster/sharding/ClusterSharding.ts:81
system
Section titled “system”
readonlysystem:ActorSystem
Defined in: src/cluster/sharding/ClusterSharding.ts:80
Methods
Section titled “Methods”start()
Section titled “start()”start<
TMsg>(settings):ActorRef<TMsg>
Defined in: src/cluster/sharding/ClusterSharding.ts:97
Start a sharded region for a type. Returns the local region ActorRef.
Type Parameters
Section titled “Type Parameters”TMsg
Parameters
Section titled “Parameters”settings
Section titled “settings”StartSettings<TMsg>
Returns
Section titled “Returns”ActorRef<TMsg>
startProxy()
Section titled “startProxy()”startProxy<
TMsg>(settings):ActorRef<TMsg>
Defined in: src/cluster/sharding/ClusterSharding.ts:118
Start a proxy region — routes to the cluster but never hosts entities.
Type Parameters
Section titled “Type Parameters”TMsg
Parameters
Section titled “Parameters”settings
Section titled “settings”Omit<StartSettings<TMsg>, "proxy">
Returns
Section titled “Returns”ActorRef<TMsg>
staticget(system,cluster):ClusterSharding
Defined in: src/cluster/sharding/ClusterSharding.ts:88
Parameters
Section titled “Parameters”system
Section titled “system”cluster
Section titled “cluster”Returns
Section titled “Returns”ClusterSharding