napi_async_cleanup_hook
与 napi_add_async_cleanup_hook 一起使用的函数指针。当环境被拆除时,它将被调用。
¥Function pointer used with napi_add_async_cleanup_hook. It will be called
when the environment is being torn down.
回调函数必须满足以下签名:
¥Callback functions must satisfy the following signature:
typedef void (*napi_async_cleanup_hook)(napi_async_cleanup_hook_handle handle,
void* data); -
[in] handle:完成异步清理后必须传递给napi_remove_async_cleanup_hook的句柄。¥
[in] handle: The handle that must be passed tonapi_remove_async_cleanup_hookafter completion of the asynchronous cleanup. -
[in] data:传递给napi_add_async_cleanup_hook的数据。¥
[in] data: The data that was passed tonapi_add_async_cleanup_hook.
函数体应启动异步清理操作,在清理操作结束时必须在调用 napi_remove_async_cleanup_hook 时传递 handle。
¥The body of the function should initiate the asynchronous cleanup actions at the
end of which handle must be passed in a call to
napi_remove_async_cleanup_hook.