Unverified Commit 9cf35255 authored by Anna Henningsen's avatar Anna Henningsen
Browse files

n-api: add helper for addons to get the event loop

Add a utility functions for addons to use when they need
a reference to the current event loop.

While the libuv API is not directly part of N-API, it
provides a quite stable C API as well, and is tightly
integrated with Node itself.

As a particular use case, without access to the event loop
it is hard to do something interesting from inside a N-API
finalizer function, since calls into JS and therefore virtually
all other N-API functions are not allowed.

PR-URL: https://github.com/nodejs/node/pull/17109


Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
parent c0f3bc24
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment