Skip to content

@epikodelabs/streamix


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

Function: withDeadline()

withDeadline(parent, deadline): [Context, Cancel]

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

Derives a child context that automatically cancels at a specific deadline.

Parameters

parent

Context

The parent context.

deadline

A Date or timestamp (in milliseconds) when the context should cancel.

number | Date

Returns

[Context, Cancel]

A tuple of [childContext, cancel].

Released under the GNU AGPL v3 or later.