Package-level declarations

Types

Link copied to clipboard
sealed external interface AsyncHook
Link copied to clipboard
external class AsyncLocalStorage<T>

This class creates stores that stay coherent through asynchronous operations.

Link copied to clipboard
open external class AsyncResource

The class AsyncResource is designed to be extended by the embedder's async resources. Using this, users can easily trigger the lifetime events of their own resources.

Link copied to clipboard
external interface AsyncResourceOptions
Link copied to clipboard
sealed external interface HookCallbacks

Functions

Link copied to clipboard
external fun createHook(callbacks: HookCallbacks): AsyncHook

Registers functions to be called for different lifetime events of each async operation.

Link copied to clipboard
external fun executionAsyncId(): Double

The ID returned from executionAsyncId() is related to execution timing, not causality (which is covered by triggerAsyncId()):

Link copied to clipboard
external fun executionAsyncResource(): Any

Resource objects returned by executionAsyncResource() are most often internal Node.js handle objects with undocumented APIs. Using any functions or properties on the object is likely to crash your application and should be avoided.

Link copied to clipboard
external fun triggerAsyncId(): Double

Promise contexts may not get valid triggerAsyncIds by default. See the section on promise execution tracking.