Skip to content

ShardSupervisor

Defined in: packages/sharding/src/supervisor.ts:22

Decides when, and whether, a crashed cluster comes back. It only does arithmetic on timestamps (pass now in tests), so ClusterManager stays in charge of forking.

new ShardSupervisor(options?, random?): ShardSupervisor

Defined in: packages/sharding/src/supervisor.ts:31

SupervisorOptions = {}

() => number

ShardSupervisor

attempts(id): number

Defined in: packages/sharding/src/supervisor.ts:88

Restarts of a cluster since it last ran stably for a whole window.

number

number


next(id, now?): number | null

Defined in: packages/sharding/src/supervisor.ts:63

A cluster exited.

number

number = ...

number | null

How many milliseconds to wait before restarting it, or null to give up because it crashed more than maxRestarts times inside window.


reset(id?): void

Defined in: packages/sharding/src/supervisor.ts:93

Forgets a cluster’s crashes, e.g. after a deliberate respawn.

number

void