Skip to content

Supervisor

Supervisor: object

Defined in: Core/Supervisor.ts:28

make: <E>(task, config) => Supervisor<E> = makeSupervisor

Creates a supervisor around a long-running task and its restart policy.

E

Result<E, void>

RetryPolicy<E>

Supervisor<E>

Supervisor for the attempt, restart, and shutdown rules.

const worker = Supervisor.make(processOutbox, {
  restart: RetryPolicy.exponential({
    attempts: 5,
    initial: Duration.seconds(1),
    maxDelay: Duration.seconds(30),
  }),
});