napi_get_uv_event_loop
NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_basic_env env,
struct uv_loop_s** loop);
-
[in] env
:调用 API 的环境。¥
[in] env
: The environment that the API is invoked under. -
[out] loop
:当前的 libuv 循环实例。¥
[out] loop
: The current libuv loop instance.
注意:虽然 libuv 随着时间的推移相对稳定,但它不提供 ABI 稳定性保证。应避免使用此功能。它的使用可能会导致插件无法在各个 Node.js 版本中使用。asynchronous-thread-safe-function-calls 是许多用例的替代方案。
¥Note: While libuv has been relatively stable over time, it does not provide an ABI stability guarantee. Use of this function should be avoided. Its use may result in an addon that does not work across Node.js versions. asynchronous-thread-safe-function-calls are an alternative for many use cases.