variable / @typed/fx

RefHashRing.add

Add a node to the HashRing.

Package version
2.0.0-beta.7
Category
State updates
Since
1.18.0
Member of
RefHashRing

Import

import { RefHashRing } from "@typed/fx";

Access RefHashRing.add through the imported RefHashRing export. Its declaration below describes the member.

This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.

Signatures

export declare const add: {
    <A extends PrimaryKey.PrimaryKey>(node: A, options?: {
        readonly weight?: number;
    }): <E, R>(ref: RefHashRing<A, E, R>) => Effect.Effect<HashRing.HashRing<A>, E, R>;
    <A extends PrimaryKey.PrimaryKey, E, R>(ref: RefHashRing<A, E, R>, node: A, options?: {
        readonly weight?: number;
    }): Effect.Effect<HashRing.HashRing<A>, E, R>;
};

Why

Add a node to the HashRing. The operation remains attached to the RefSubject’s versioned state boundary.

Ownership and lifetime

Running add performs one serialized hash ring transition and resolves with its committed value. It acquires no resource; failures and services remain those of the source ref.

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source