napi_queue_async_work


napi_status napi_queue_async_work(node_api_nogc_env env,
                                  napi_async_work work); 
  • [in] env:调用 API 的环境。

    ¥[in] env: The environment that the API is invoked under.

  • [in] work:调用 napi_create_async_work 返回的句柄。

    ¥[in] work: The handle returned by the call to napi_create_async_work.

如果 API 成功,则返回 napi_ok

¥Returns napi_ok if the API succeeded.

此 API 请求安排执行先前分配的工作。成功返回后,不得使用相同的 napi_async_work 项再次调用此 API,否则结果将不确定。

¥This API requests that the previously allocated work be scheduled for execution. Once it returns successfully, this API must not be called again with the same napi_async_work item or the result will be undefined.