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

@std/async@0.219.1
Built and signed on GitHub Actions

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.219.1)

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

Error thrown when Deadline times out.

I
DeadlineOptions

Options for Deadline.

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.

f
delay

Resolve a Promise after a given amount of milliseconds.

I
DelayOptions

Options for delay.

v
ERROR_WHILE_MAPPING_MESSAGE

Error message emitted from the thrown error while mapping.

c
MuxAsyncIterator

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 a RetryError with cause set to the inner exception.

c
RetryError

Error thrown in retry once the maximum number of failed attempts has been reached.

f
tee

Branches the given async iterable into the n branches.

T
Tuple

Utility for representing n-tuple. Used in tee.

T
TupleOf

Utility for representing n-tuple of. Used in Tuple.

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

Error thrown when Deadline times out.

I
DeadlineOptions

Options for Deadline.

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.

f
delay

Resolve a Promise after a given amount of milliseconds.

I
DelayOptions

Options for delay.

c
MuxAsyncIterator

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

Error message emitted from the thrown error while mapping.

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 a RetryError with cause set to the inner exception.

c
RetryError

Error thrown in retry once the maximum number of failed attempts has been reached.

f
tee

Branches the given async iterable into the n branches.

T
Tuple

Utility for representing n-tuple. Used in tee.

T
TupleOf

Utility for representing n-tuple of. Used in Tuple.

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.