Skip to content

Function: timeoutSignal()

function timeoutSignal(ms): object;

Defined in: rine-ts-sdk/src/utils/abort.ts:25

Create a signal that fires after ms milliseconds.

Returns a { signal, clear } pair. Callers MUST invoke clear() in a finally block (or equivalent) to cancel the timer on early completion — otherwise the timer will still fire, aborting an already-settled signal and leaking a timer handle per call. clear() is idempotent.

When the timer fires, the signal is aborted with an RineTimeoutError reason so catch sites can distinguish an SDK timeout from a user-cancel via err instanceof RineTimeoutError.

Parameters

Parameter Type
ms number

Returns

object

Name Type Defined in
clear() () => void rine-ts-sdk/src/utils/abort.ts:27
signal AbortSignal rine-ts-sdk/src/utils/abort.ts:26