Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > Async > runWithTimeoutAsync

Async.runWithTimeoutAsync() method

Runs a promise with a timeout. If the promise does not resolve within the specified timeout, it will reject with an error.

Signature:

static runWithTimeoutAsync<TResult>(input: IRunWithTimeoutOptions<TResult>): Promise<TResult>;

Parameters

Parameter

Type

Description

{ action, timeoutMs, timeoutMessage }

(not declared)

input

IRunWithTimeoutOptions<TResult>

Returns:

Promise<TResult>

Remarks

If the action is completely synchronous, runWithTimeoutAsync doesn't do anything meaningful.