effect-io-ai

Package: effect
Module: HashRing

HashRing.getShards

Distributes count shards across the nodes in the ring, attempting to balance the number of shards allocated to each node. Returns undefined if the hashring has no elements with weight.

Signature

declare const getShards: <A extends PrimaryKey.PrimaryKey>(self: HashRing<A>, count: number) => Array<A> | undefined

Source

Since v3.19.0