Pular para o conteúdo
Português (BR)

EntityContext

Este conteúdo não está disponível em sua língua ainda.

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.

readonly entityId: string

Defined in: src/EntityContext.ts:17

The id extractEntityId produced, unmodified.


readonly shardId: number

Defined in: src/EntityContext.ts:23

Shard hosting it — hash(entityId) % numShards.


readonly typeName: string

Defined in: src/EntityContext.ts:20

Sharded type this entity belongs to — StartShardingOptions.typeName.