Module / v2.0.0-beta.7

@typed/fx/RefHashRing

13 unique exports available through this public import path, including their members and aliases.

import * as RefHashRing from "@typed/fx/RefHashRing";

Constructors

  • empty

    function

    Creates a new empty RefHashRing.

  • make

    function

    Creates a new RefHashRing from a HashRing, Effect, or Fx.

Derived queries

  • getNode

    variable

    Get the node which should handle a given input string as a Computed. Returns undefined if the ring is empty.

  • getShards

    variable

    Get shard distribution across nodes.

  • size

    variable

    Get the number of nodes in the HashRing.

  • values

    variable

    Get all nodes as an array.

Optional queries

  • get

    variable

    Get the node which should handle a given input string as a Filtered. Fails if the ring is empty.

State models

  • RefHashRing

    interface

    A RefHashRing is a RefSubject specialized over a HashRing.

State predicates

  • has

    variable

    Check if a node exists in the HashRing.

  • isEmpty

    variable

    Check if the HashRing is empty.

State updates

  • add

    variable

    Add a node to the HashRing.

  • addMany

    variable

    Add multiple nodes to the HashRing.

  • remove

    variable

    Remove a node from the HashRing.