A signal that communicates the process should be aborted.
A promise who's value will be returned if not aborted.
A value indicating if the process was aborted, or the value of
promise
.
Converts an async generator to an array of results.
The generator to convert.
A promise that resolves with an array of results yielded by the generator.
Returns a promise that resolves successfully after the given delay.
The delay in milliseconds.
Delays the resolution of promise
by the given delay.
The delay in milliseconds.
The promise to delay.
Executes and reattempts execution of an asynchronous function if it throws an
error. By default, this function will only retry once and reexecute
immediately after the previous execution throws. You can configure the number
of retry attempts and delays with the maxRetries
and delaysInMs
options.
The delaysInMs
is an array of delays in milliseconds for each retry
attempt. If there are more retry attempts than delays, the last delay will be
used.
The process to execute.
Options to configure retry behavior.
A promise that resolves with a successful value, or the original rejected value if the process fails.
Returns a promise that will reject after the given duration.
A duration in milliseconds.
Assigns a timeout to the given promise, where if the promise doesn't complete within the given duration an exception will be thrown.
The timeout, in milliseconds.
The promise to assign a timeout to.
Returns a promise that either resolves with the result of
promise
, or a value that indicates the execution was aborted.Note: Because Promises in JS cannot be canceled, an abort signal will not cancel the execution of the promise.