napi_async_init

Function napi_async_init 

Source
pub unsafe extern "C" fn napi_async_init(
    env: napi_env,
    async_resource: napi_value,
    async_resource_name: napi_value,
    result: *mut napi_async_context,
) -> napi_status
Available on crate features napi and api-11 only.
Expand description

Creates an asynchronous context. The capabilities related to ‘async_hook’ are not supported currently.

§Arguments

  • env - Current running virtual machine context.

  • async_resource - Object associated with the async work that will be passed to possible ‘async_hook’.

  • async_resource_name - Identifier for the kind of resource that is being provided for diagnostic information exposed by the async_hooks API.

  • result - The initialized async context.

§Returns

  • Returns the function execution status.

Available since API-level: 11