Skip to main content
Home
This release is 43 versions behind 1.0.16 — the latest version of @std/async. Jump to latest

Utilities for asynchronous operations, like delays, debouncing, or pooling

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 years ago (0.205.0)

default

Provide help with asynchronous tasks like delays, debouncing, deferring, or pooling.

f
abortable

Make Promise abortable with the given signal.

f
abortableAsyncIterable

Make AsyncIterable abortable with the given signal.

f
abortablePromise

Make Promise abortable with the given signal.

f
deadline

Create a promise which will be rejected with DeadlineError when a given delay is exceeded.

c
DeadlineError
No documentation available
I
DeadlineOptions
No documentation available
f
debounce

Creates a debounced function that delays the given func by a given wait time in milliseconds. If the method is called again before the timeout expires, the previous call will be aborted.

I
DebouncedFunction

A debounced function that will be delayed by a given wait time in milliseconds. If the method is called again before the timeout expires, the previous call will be aborted.

I
Deferred
No documentation available
f
deferred

Creates a Promise with the reject and resolve functions placed as methods on the promise object itself.

f
delay

Resolve a Promise after a given amount of milliseconds.

I
DelayOptions
No documentation available
v
ERROR_WHILE_MAPPING_MESSAGE
No documentation available
c
MuxAsyncIterator

The MuxAsyncIterator class multiplexes multiple async iterators into a single stream. It currently makes an assumption that the final result (the value returned and not yielded from the iterator) does not matter; if there is any result, it is discarded.

f
pooledMap

pooledMap transforms values from an (async) iterable into another async iterable. The transforms are done concurrently, with a max concurrency defined by the poolLimit.

f
retry

Calls the given (possibly asynchronous) function up to maxAttempts times. Retries as long as the given function throws. If the attempts are exhausted, throws an RetryError with cause set to the inner exception.

c
RetryError
No documentation available
f
tee

Branches the given async iterable into the n branches.

f
abortable

Make Promise abortable with the given signal.

f
abortableAsyncIterable

Make AsyncIterable abortable with the given signal.

f
abortablePromise

Make Promise abortable with the given signal.

f
deadline

Create a promise which will be rejected with DeadlineError when a given delay is exceeded.

c
DeadlineError
No documentation available
I
DeadlineOptions
No documentation available
f
debounce

Creates a debounced function that delays the given func by a given wait time in milliseconds. If the method is called again before the timeout expires, the previous call will be aborted.

I
DebouncedFunction

A debounced function that will be delayed by a given wait time in milliseconds. If the method is called again before the timeout expires, the previous call will be aborted.

I
Deferred
No documentation available
f
deferred

Creates a Promise with the reject and resolve functions placed as methods on the promise object itself.

f
delay

Resolve a Promise after a given amount of milliseconds.

I
DelayOptions
No documentation available
c
MuxAsyncIterator

The MuxAsyncIterator class multiplexes multiple async iterators into a single stream. It currently makes an assumption that the final result (the value returned and not yielded from the iterator) does not matter; if there is any result, it is discarded.

v
ERROR_WHILE_MAPPING_MESSAGE
No documentation available
f
pooledMap

pooledMap transforms values from an (async) iterable into another async iterable. The transforms are done concurrently, with a max concurrency defined by the poolLimit.

f
retry

Calls the given (possibly asynchronous) function up to maxAttempts times. Retries as long as the given function throws. If the attempts are exhausted, throws an RetryError with cause set to the inner exception.

c
RetryError
No documentation available
f
tee

Branches the given async iterable into the n branches.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.