Nexus API Reference

ConsistentHashRing
in package

Read onlyYes
FinalYes
Tags
psalm-api
psalm-immutable

Deterministic consistent hash ring for mapping actor names to worker IDs. Uses crc32 with virtual nodes for even distribution. Same output on all workers — no coordination needed.

Table of Contents

Methods

__construct()  : mixed
getWorker()  : int
Returns the worker ID that owns the given actor name.

Methods

__construct()

public __construct(int $workerCount[, int $virtualNodes = self::VIRTUAL_NODES ]) : mixed
Parameters
$workerCount : int
$virtualNodes : int = self::VIRTUAL_NODES

getWorker()

Returns the worker ID that owns the given actor name.

public getWorker(string $name) : int
Parameters
$name : string
Return values
int

        
On this page

Search results