Runner
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.
Constructors
Models
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 Runner extends {
readonly address: RunnerAddress;
readonly groups: readonly Array<string>;
readonly weight: number;
} {
constructor(...args: [props: {
readonly address: RunnerAddress;
readonly groups: readonly Array<string>;
readonly weight: number;
}, options?: MakeOptions]);
readonly "~effect/cluster/Runner": "~effect/cluster/Runner";
static readonly decodeSync: (input: string, options?: ParseOptions) => Runner;
static readonly encodeSync: (input: Runner, options?: ParseOptions) => string;
static format: Formatter<Runner, string>;
[NodeInspectSymbol](): string;
"~effect/interfaces/Equal"(that: Runner): boolean;
"~effect/interfaces/Hash"(): number;
toString(): string;
}
Constructs a
Runnerfrom 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
groupsarray lists the shard groups the runner can host. During shard assignment, the runner's address is added to each group's hash ring withweightas its relative weight.Gotchas
This helper constructs the value without runtime schema validation, so only pass trusted
RunnerAddress,groups, andweightvalues.See
Runnerfor the value created by this helperRunnerAddressfor the network address accepted inprops.address