EntityId.ts
EntityId.ts overview
Section titled “EntityId.ts overview”The EntityId module defines the branded string used to identify one entity
instance within an entity type. The value is the routing key that sharding
hashes, stores in entity addresses, and uses when sending messages to a
running entity.
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”constructors
Section titled “constructors”EntityId
Section titled “EntityId”Schema for branded string entity identifiers used inside the cluster.
Signature
declare const EntityId: Schema.brand<Schema.String, "~effect/cluster/EntityId">Since v4.0.0
Brands a string as an EntityId.
When to use
Use to turn a trusted, stable entity routing key into an EntityId before
passing it to cluster APIs.
Details
The branded value is the original string at runtime.
Gotchas
make does not validate, normalize, or make the value unique. Choose
deterministic strings because cluster routing hashes the exact entity id
value.
See
EntityIdfor the schema that validates and encodes branded entity identifiers
Signature
declare const make: (id: string) => EntityIdSince v4.0.0
models
Section titled “models”EntityId (type alias)
Section titled “EntityId (type alias)”Branded string type representing the ID of an entity instance.
Signature
type EntityId = typeof EntityId.TypeSince v4.0.0