EntityContext
EntityContext =
object
Defined in: src/EntityContext.ts:15
Sharding identity of an actor that ClusterSharding started as an entity:
the id it was routed by, and where that routing put it.
It lives in core rather than under cluster/sharding/ because ActorOptions
carries it in and ActorContext hands it out — the runtime has to be able
to give an actor its own identity without core depending on the cluster
layer.
The id cannot be recovered from the actor’s path: Shard folds every
character outside [A-Za-z0-9_-] to _ to make a legal child name, so
user:42 and user/42 share a path but are two different entities. This
is the only place the routed value survives verbatim.
Properties
Section titled “Properties”entityId
Section titled “entityId”
readonlyentityId:string
Defined in: src/EntityContext.ts:17
The id extractEntityId produced, unmodified.
shardId
Section titled “shardId”
readonlyshardId:number
Defined in: src/EntityContext.ts:23
Shard hosting it — hash(entityId) % numShards.
typeName
Section titled “typeName”
readonlytypeName:string
Defined in: src/EntityContext.ts:20
Sharded type this entity belongs to — StartShardingOptions.typeName.
