Context of applying for async handlers
Map for task identifiers
The lock status. If true, then all new tasks won't be registered.
Set of used async namespaces
Cache for initialized workers
Map of namespaces for async operations
Link to Async.namespaces
Wrapper for globalThis.cancelIdleCallback
Clears the specified "requestIdleCallback" timer or a group of timers
options for the operation
Cancels the specified iterable object.
Notice that cancellation affects only objects that have already been activated by invoking the next
method.
So, for example, canceled iterable will throw an error on the next invoking of next
.
Cancels the specified iterable or a group of iterable.
Notice that cancellation affects only objects that have already been activated by invoking the next
method.
So, for example, canceled iterable will throw an error on the next invoking of next
.
options for the operation
Cancels the specified promise. The canceled promise will be automatically rejected.
Cancels the specified promise or a group of promises. The canceled promises will be automatically rejected.
options for the operation
Cancels the specified proxy function
Cancels the specified proxy function or a group of functions
options for the operation
Cancels the specified request. The canceled promise will be automatically rejected.
Cancels the specified request or a group of requests. The canceled promises will be automatically rejected.
options for the operation
Cancels a task (or a group of tasks) from the specified namespace
operation options or task link
Clears all async tasks
Removes the specified event listener
Removes the specified event listener or a group of listeners. Notice, you can't remove event listeners by a label without providing a group.
options for the operation
Wrapper for globalThis.cancelIdleCallback
Clears the specified "requestIdleCallback" timer or a group of timers
options for the operation
Wrapper for globalThis.clearImmediate
Clears the specified "setImmediate" timer or a group of timers
options for the operation
Wrapper for globalThis.clearInterval
Clears the specified "setInterval" timer or a group of timers
options for the operation
Cancels the specified iterable object.
Notice that cancellation affects only objects that have already been activated by invoking the next
method.
So, for example, canceled iterable will throw an error on the next invoking of next
.
Cancels the specified iterable object.
Notice that cancellation affects only objects that have already been activated by invoking the next
method.
So, for example, canceled iterable will throw an error on the next invoking of next
.
options for the operation
Cancels the specified promise. The canceled promise will be automatically rejected.
Cancels the specified promise or a group of promises. The canceled promises will be automatically rejected.
options for the operation
Cancels the specified proxy function
Cancels the specified proxy function or a group of functions
options for the operation
Cancels the specified request. The canceled promise will be automatically rejected.
Cancels the specified request or a group of requests. The canceled promises will be automatically rejected.
options for the operation
Wrapper for globalThis.clearTimeout
Clears the specified "setTimeout" timer or a group of timers
options for the operation
Terminates the specified worker
Terminates the specified worker or a group of workers
options for the operation
Returns a new function that allows invoking the passed function only with the specified delay. The next invocation of the function will cancel the previous.
Removes the passed event listener from the specified emitter
event object
Returns an iterator from the passed iterable object. Notice, an asynchronous iterator has more priority.
Returns a cache object by the specified name
Returns a promise that will be resolved on the process idle
Creates a new asynchronous iterable object from the specified iterable and returns it.
If the passed iterable doesn't have Symbol.asyncIterator
, it will be created from a synchronous object iterator
(the synchronous iterator will also be preserved).
Notice, until the created promise object isn't executed by invoking the next
method,
any async operations won't be registered.
Marks all async tasks from the namespace by the specified label
operation options
Marks an event task with the specified label
Marks an event task or group of tasks with the specified label
additional options
Marks a promise with the specified label
Marks a promise or group of promises with the specified label
additional options
Marks a task (or a group of tasks) from the namespace by the specified label
operation options or a link to the task
Mutes all async tasks
Mutes the specified event listener
Mutes the specified event listener or a group of listeners. Notice, you can't mute event listeners by a label without providing a group.
options for the operation
Mutes the specified "requestIdleCallback" timer
Mutes the specified "requestIdleCallback" timer or a group of timers
options for the operation
Mutes the specified "setImmediate" timer
Mutes the specified "setImmediate" timer or a group of timers
options for the operation
Mutes the specified "setInterval" timer
Mutes the specified "setInterval" timer or a group of timers
options for the operation
Mutes the specified iterable object.
Elements that are consumed during the object is muted will be ignored.
Notice that muting affects only objects that have already been activated by invoking the next
method.
Mutes the specified iterable object or a group of iterable objects.
Elements, that are consumed during the object is muted will be ignored.
Notice that muting affects only objects that have already been activated by invoking the next
method.
options for the operation
Mutes the specified promise. If the promise is resolved during it muted, the promise wrapper will be rejected.
Mutes the specified promise or a group of promises. If the promises are resolved during muted, the promise wrappers will be rejected.
options for the operation
Mutes the specified proxy function
Mutes the specified proxy function or a group of functions
options for the operation
Mutes the specified request. If the request is resolved during it muted, the promise wrapper will be rejected.
Mutes the specified request or a group of requests. If the requests are resolved during muted, the promise wrappers will be rejected.
options for the operation
Mutes the specified "setTimeout" timer
Mutes the specified "setTimeout" timer or a group of timers
options for the operation
Returns a promise that will be resolved on the next tick of the event loop
Removes the specified event listener
Removes the specified event listener or a group of listeners. Notice, you can't remove event listeners by a label without providing a group.
options for the operation
Attaches an event listener from the specified event emitter. If the emitter is a function, it is interpreted as the function to attach events. Notice, if you don't provide a group for the operation, it will be taken from the event name.
event emitter
event or list of events (can also specify multiple events by using spaces)
event handler
Attaches an event listener from the specified event emitter. If the emitter is a function, it is interpreted as the function to attach events. Notice, if you don't provide a group for the operation, it will be taken from the event name.
event emitter
event or list of events (can also specify multiple events by using spaces)
event handler
options for the operation
Factory to create promise clear handlers
Factory to create promise merge handlers
Attaches an event listener from the specified event emitter, but the event is listened only once. If the emitter is a function, it is interpreted as the function to attach events. Notice, if you don't provide a group for the operation, it will be taken from the event name.
event emitter
event or list of events (can also specify multiple events by using spaces)
event handler
Attaches an event listener from the specified event emitter, but the event is listened only once. If the emitter is a function, it is interpreted as the function to attach events. Notice, if you don't provide a group for the operation, it will be taken from the event name.
event emitter
event or list of events (can also specify multiple events with a space)
event handler
options for the operation
Creates a new promise that wraps the passed promise and returns it.
This method doesn't attach any hook or listeners to the object, but if we cancel the operation by using one of Async's methods, like, "cancelPromise", the promise will be rejected.
The promise can be provided as it is or as a function, that returns a promise.
Terminates the specified promise
name of the destructor method
Returns a promise that is resolved after emitting the specified event. If the emitter is a function, it is interpreted as the function to attach events. Notice, if you don't provide a group for the operation, it will be taken from the event name.
event emitter
event or list of events (can also specify multiple events with a space)
options for the operation
Returns a promise that is resolved after emitting the specified event. If the emitter is a function, it is interpreted as the function to attach events. Notice, if you don't provide a group for the operation, it will be taken from the event name.
event emitter
event or list of events (can also specify multiple events with a space)
Creates a new function that wraps the original and returns it.
This method doesn't attach any hook or listeners to the object,
but if we cancel the operation by using one of Async's methods, like, cancelProxy
,
the target function won't be invoked.
Registers the specified async task
Creates a promise that wraps the passed request and returns it.
This method doesn't attach any hook or listeners to the object, but if we cancel the operation by using one of Async's methods, like, "cancelRequest", the promise will be rejected.
The request can be provided as a promise or function, that returns a promise.
Notice, the method uses Async.promise
, but with a different namespace: request
instead of promise
.
Wrapper for globalThis.requestIdleCallback
callback function
Wrapper for globalThis.setImmediate
callback function
Wrapper for globalThis.setInterval
callback function
timer value
Wrapper for globalThis.setTimeout
callback function
timeout value
Returns a promise that will be resolved after the specified timeout
Suspends all async tasks
Suspends the specified event listener
Suspends the specified event listener or a group of listeners. Notice, you can't suspend event listeners by a label without providing a group.
options for the operation
Suspends the specified "requestIdleCallback" timer
Suspends the specified "requestIdleCallback" timer or a group of timers
options for the operation
Suspends the specified "setImmediate" timer
Suspends the specified "setImmediate" timer or a group of timers
options for the operation
Suspends the specified "setInterval" timer
Suspends the specified "setInterval" timer or a group of timers
options for the operation
Suspends the specified iterable object.
Notice that suspending affects only objects that have already been activated by invoking the next
method.
Suspends the specified iterable or a group of iterable objects.
Notice that suspending affects only objects that have already been activated by invoking the next
method.
options for the operation
Suspends the specified promise
Suspends the specified promise or a group of promises
options for the operation
Suspends the specified proxy function
Suspends the specified proxy function or a group of functions
options for the operation
Suspends the specified request
Suspends the specified request or a group of requests
options for the operation
Suspends the specified "setTimeout" timer
Suspends the specified "setTimeout" timer or a group of timers
options for the operation
Terminates the specified worker
Terminates the specified worker or a group of workers
options for the operation
Returns a new function that allows invoking the passed function not more often than the specified delay
Unmutes all async tasks
Unmutes the specified event listener
Unmutes the specified event listener or a group of listeners. Notice, you can't unmute event listeners by a label without providing a group.
options for the operation
Unmutes the specified "requestIdleCallback" timer
Unmutes the specified "requestIdleCallback" timer or a group of timers
options for the operation
Unmutes the specified "setImmediate" timer
Unmutes the specified "setImmediate" timer or a group of timers
options for the operation
Unmutes the specified "setInterval" timer
Unmutes the specified "setInterval" timer or a group of timers
options for the operation
Unmutes the specified iterable object
Unmutes the specified iterable function or a group of iterable objects
options for the operation
Unmutes the specified promise
Unmutes the specified promise or a group of promises
options for the operation
Unmutes the specified proxy function
Unmutes the specified proxy function or a group of functions
options for the operation
Unmutes the specified request
Unmutes the specified request or a group of requests
options for the operation
Unmutes the specified "setTimeout" timer
Unmutes the specified "setTimeout" timer or a group of timers
options for the operation
Unsuspends all async tasks
Unsuspends the specified event listener
Unsuspends the specified event listener or a group of listeners. Notice, you can't unsuspend event listeners by a label without providing a group.
options for the operation
Unsuspends the specified "requestIdleCallback" timer
Unsuspends the specified "requestIdleCallback" timer or a group of timers
options for the operation
Unsuspends the specified "setImmediate" timer
Unsuspends the specified "setImmediate" timer or a group of timers
options for the operation
Unsuspends the specified "setImmediate" timer
Unsuspends the specified "setImmediate" timer or a group of timers
options for the operation
Unsuspends the specified iterable object
Unsuspends the specified iterable or a group of iterable objects
options for the operation
Unsuspends the specified promise
Unsuspends the specified promise or a group of promises
options for the operation
Unsuspends the specified proxy function
Unsuspends the specified proxy function or a group of functions
options for the operation
Unsuspends the specified request
Unsuspends the specified request or a group of requests
options for the operation
Unsuspends the specified "setTimeout" timer
Unsuspends the specified "setTimeout" timer or a group of names
options for the operation
Returns a promise that will be resolved only when the specified function returns a positive value (== true)
Wraps the specified worker object.
This method doesn't attach any hook or listeners to the object,
but every time the same object is registered, Async will increment the number of links that relate to this object.
After, when we try to destroy the worker by using one of Async's methods, like, terminateWorker
,
it will de-increment values of links. When the number of links is equal to zero,
Async will try to call a "real" object destructor by using one of the possible destructor methods from
the whitelist or by the specified destructor name, also if the worker is a function,
it is interpreted as the destructor.
Terminates the specified worker
name of the destructor method
The wrapper takes a link to the "raw" data provider and returns a new object that based on the original, but all async methods and properties are wrapped by Async. Notice, the wrapped methods can take additional Async parameters, like group or label. If you don't provide a group, it will be taken from the provider name.
The wrapper takes a link to the "raw" event emitter and returns a new object that based on the original, but all async methods and properties are wrapped by Async. Notice, the wrapped methods can take additional Async parameters, like group or label. In addition, the wrapper adds new methods, like "on" or "off", to make the emitter API more standard.
The wrapper takes a link to the "raw" async storage and returns a new object that based on the original, but all async methods and properties are wrapped by Async. Notice, the wrapped methods can take additional Async parameters, like group or label.
Cache for async operations