[]previous and next page

SuperviseOptions

Settings of the supervision of a worker pool.

Settings of the supervision of a worker pool.

Import#

ts
import type { SuperviseOptions } from "@shadow-js/dusk/node";

Signature#

ts
interface SuperviseOptions {
  /** Delay before the first replacement of a crashed worker, in milliseconds; it doubles for each crash in a row. Default 500. */
  readonly restartBackoffMs?: number;
  /** Longest delay before a replacement, in milliseconds. Default 30 000. */
  readonly maxRestartBackoffMs?: number;
  /** Crashes within `crashWindowMs` that stop the pool (the crash-loop breaker). Default 5. */
  readonly maxCrashes?: number;
  /** The window of the breaker, in milliseconds. Also how long a worker must stay up before its crashes are forgiven. Default 30 000. */
  readonly crashWindowMs?: number;
  /** How long a worker may take to start listening before it is killed, in milliseconds. Default 30 000. */
  readonly readyTimeoutMs?: number;
  /**
   * The signal that starts a rolling restart. Default `"SIGUSR2"`; `false` registers none. Windows has no such signal:
   * call {@link PoolControl.restart} there.
   */
  readonly restartSignal?: false | string;
  /** Receives the primary's messages (a worker died, a restart ended, a warning). Default: `console.error` with a `[dusk]` prefix. */
  readonly log?: (message: string) => void;
}

Members#

Name Type Description
restartBackoffMs? readonly restartBackoffMs?: number Delay before the first replacement of a crashed worker, in milliseconds; it doubles for each crash in a row. Default 500.
maxRestartBackoffMs? readonly maxRestartBackoffMs?: number Longest delay before a replacement, in milliseconds. Default 30 000.
maxCrashes? readonly maxCrashes?: number Crashes within crashWindowMs that stop the pool (the crash-loop breaker). Default 5.
crashWindowMs? readonly crashWindowMs?: number The window of the breaker, in milliseconds. Also how long a worker must stay up before its crashes are forgiven. Default 30 000.
readyTimeoutMs? readonly readyTimeoutMs?: number How long a worker may take to start listening before it is killed, in milliseconds. Default 30 000.
restartSignal? readonly restartSignal?: false | string The signal that starts a rolling restart. Default "SIGUSR2"; false registers none. Windows has no such signal: call PoolControl.restart there.
log? readonly log?: (message: string) => void Receives the primary's messages (a worker died, a restart ended, a warning). Default: console.error with a [dusk] prefix.