MachineId
Branded integer identifiers for cluster runners. A MachineId marks the machine component used by cluster services, especially snowflake id generation, while keeping the value distinct from an ordinary number in TypeScript APIs.
Constructors
Signature
declare const MachineId: brand<Int, "~effect/cluster/MachineId">;Brands a number as a MachineId.
When to use
Use to turn a trusted numeric machine id into the branded type when implementing runner storage adapters or configuring snowflake generation.
Details
The branded value is the original number at runtime.
Gotchas
make does not validate integer input or enforce the snowflake machine-id range. Snowflake ids encode the machine component modulo 1024.
See
MachineIdfor the schema that validates branded integer machine identifiers
Signature
declare function make(id: number): number & Brand<"~effect/cluster/MachineId">;
Schema for branded integer machine identifiers used by the cluster.