ShardingSettings
Defined in: src/cluster/sharding/ShardRegion.ts:36
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”TMsg
Properties
Section titled “Properties”entityProps
Section titled “entityProps”
readonlyentityProps:Props<TMsg>
Defined in: src/cluster/sharding/ShardRegion.ts:38
extractEntityId
Section titled “extractEntityId”
readonlyextractEntityId: (message) =>string
Defined in: src/cluster/sharding/ShardRegion.ts:39
Parameters
Section titled “Parameters”message
Section titled “message”TMsg
Returns
Section titled “Returns”string
extractEntityMessage?
Section titled “extractEntityMessage?”
readonlyoptionalextractEntityMessage?: (message) =>unknown
Defined in: src/cluster/sharding/ShardRegion.ts:40
Parameters
Section titled “Parameters”message
Section titled “message”TMsg
Returns
Section titled “Returns”unknown
maxEntities?
Section titled “maxEntities?”
readonlyoptionalmaxEntities?:number
Defined in: src/cluster/sharding/ShardRegion.ts:66
Cap the number of locally-hosted entities (#82). When the region
is about to spawn a new entity and the existing count is already
maxEntities, the entity with the oldest lastActivity is
passivated — same code path users invoke manually via
Passivate. Useful for unbounded entity sets (per-user
sessions, IoT devices, …) where a memory cap per node matters
more than keeping every cold entity resident.
Default: 0 (no cap). Eviction runs only when > 0.
Note: passivation is asynchronous, so during the brief window
between “stop the LRU” and “Terminated arrives” the region may
hold maxEntities + 1 entities; the cap is a steady-state
upper bound rather than a strict instantaneous one.
numShards?
Section titled “numShards?”
readonlyoptionalnumShards?:number
Defined in: src/cluster/sharding/ShardRegion.ts:41
passivationIdleMs?
Section titled “passivationIdleMs?”
readonlyoptionalpassivationIdleMs?:number
Defined in: src/cluster/sharding/ShardRegion.ts:49
Notify the region after an entity has been idle this many ms.
proxy?
Section titled “proxy?”
readonlyoptionalproxy?:boolean
Defined in: src/cluster/sharding/ShardRegion.ts:45
Run as a proxy — route messages but never host entities locally.
rememberEntities?
Section titled “rememberEntities?”
readonlyoptionalrememberEntities?:boolean
Defined in: src/cluster/sharding/ShardRegion.ts:47
Track entity lifecycle so entities can be re-created on the new owner.
readonlyoptionalrole?:string
Defined in: src/cluster/sharding/ShardRegion.ts:43
Members must carry this role to be candidates for hosting shards.
typeName
Section titled “typeName”
readonlytypeName:string
Defined in: src/cluster/sharding/ShardRegion.ts:37