Runner.ts
Runner.ts overview
Section titled “Runner.ts overview”Cluster runner metadata for processes that can host entity shards.
A Runner combines the stable RunnerAddress used to contact a process, the
shard groups that process participates in, and the relative weight used when
the sharding service distributes shards across healthy runners.
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”constructors
Section titled “constructors”Constructs a Runner from its network address, shard groups, and relative
shard-assignment weight.
When to use
Use to build runner metadata from an existing RunnerAddress, shard groups,
and relative weight when registering or exchanging a cluster runner.
Details
The groups array lists the shard groups the runner can host. During shard
assignment, the runner’s address is added to each group’s hash ring with
weight as its relative weight.
Gotchas
This helper constructs the value without runtime schema validation, so only
pass trusted RunnerAddress, groups, and weight values.
See
Runnerfor the value created by this helperRunnerAddressfor the network address accepted inprops.address
Signature
declare const make: (props: { readonly address: RunnerAddress readonly groups: ReadonlyArray<string> readonly weight: number}) => RunnerSince v4.0.0
models
Section titled “models”Runner (class)
Section titled “Runner (class)”Represents a cluster runner that can host entities.
Details
Each runner has a unique network address, the shard groups it participates
in, and a relative weight used when assigning shards across runners.
Signature
declare class RunnerSince v4.0.0
toString (method)
Section titled “toString (method)”Formats this runner as a string.
Signature
declare const toString: () => stringSince v4.0.0
[NodeInspectSymbol] (method)
Section titled “[NodeInspectSymbol] (method)”Formats this runner for Node.js inspection.
Signature
declare const [NodeInspectSymbol]: () => stringSince v4.0.0
[Equal.symbol] (method)
Section titled “[Equal.symbol] (method)”Compares runners by address and shard-assignment weight.
Signature
declare const [Equal.symbol]: (that: Runner) => booleanSince v4.0.0
[Hash.symbol] (method)
Section titled “[Hash.symbol] (method)”Computes a structural hash from the runner address and shard-assignment weight.
Signature
declare const [Hash.symbol]: () => numberSince v4.0.0
[TypeId] (property)
Section titled “[TypeId] (property)”Marks this value as a cluster runner for runtime guards.
Signature
readonly [TypeId]: "~effect/cluster/Runner"Since v4.0.0