Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / coroutines/src/public-api / withTimeout

Function: withTimeout()

withTimeout(parent, ms): [Context, Cancel]

Defined in: projects/libraries/streamix/coroutines/src/lib/utils/context.ts:127

Derives a child context that automatically cancels after a timeout.

Parameters

parent

Context

The parent context.

ms

number

Timeout in milliseconds.

Returns

[Context, Cancel]

A tuple of [childContext, cancel].

Released under the GNU AGPL v3 or later.