Skip to main content

Class: DeadlineController

Defined in: provider-sdk/src/timeouts.ts:37

An AbortSignal that fires on the caller's abort OR on a re-armable deadline. Deadline aborts carry a TIMEOUT AppError as the abort reason, so fetch rejections propagate a structured error instead of a bare AbortError.

Constructors

Constructor

new DeadlineController(caller): DeadlineController

Defined in: provider-sdk/src/timeouts.ts:44

Parameters

caller

AbortSignal

Returns

DeadlineController

Properties

signal

readonly signal: AbortSignal

Defined in: provider-sdk/src/timeouts.ts:39

Signal to hand to fetch / stream readers.

Methods

arm()

arm(ms, message): void

Defined in: provider-sdk/src/timeouts.ts:54

(Re)start a deadline. Any previous deadline is cleared first.

Parameters

ms

number

message

string

Returns

void


disarm()

disarm(): void

Defined in: provider-sdk/src/timeouts.ts:64

Clear the current deadline without aborting.

Returns

void


dispose()

dispose(): void

Defined in: provider-sdk/src/timeouts.ts:72

Clear the deadline and detach from the caller signal.

Returns

void