Signature
tsSignature
export function timeout<I, O, E, C extends object>( source: Behavior<I, O, E, C>, ms: number,): Behavior<I, O, E | TimingError, C>;Imports
tsImport
import { timeout } from "@/lib/flow/timeout";import { timeout } from "@/lib/flow";Type Parameters
Parameters
Returns
A behavior with the source result or timing errors.
Return type
Behavior<I, O, E | TimingError, C>Details
The source runs with a child signal linked to the parent. If the timer expires first, the child
is aborted and a timeout domain error is returned.
Examples
tsExample
const boundedLoad = timeout(loadUser, 1000);Related Symbols
Behavior
Executable Flow workflow unit.
type
type
Source
tsflow/timeout.ts:46-51
export function timeout<I, O, E, C extends object>( source: Behavior<I, O, E, C>, ms: number,): Behavior<I, O, E | TimingError, C> { return async (input, context) => runWithTimeout(source, input, context, ms);}