deno
9584b5a8 - fix(ext/napi): implement uv timer/idle/check/ref/unref via core uv_compat

Commit
227 days ago
fix(ext/napi): implement uv timer/idle/check/ref/unref via core uv_compat Wire NAPI uv functions to the core uv_compat event loop instead of using no-op stubs. Native addons (e.g. zeromq) that call libuv timer, idle, check, ref/unref, and close functions now get real implementations integrated with deno_core's event loop. Architecture: each NAPI handle (libuv-ABI-compatible layout) internally allocates a shadow core-layout handle and forwards operations. The core event loop drives callbacks via trampolines that translate back to the NAPI handles. Changes: - Add uv_loop_ptr to NAPI Env, populated from OpState's UvLoop - Implement uv_timer_{init,start,stop,again,set_repeat,get_repeat} - Implement uv_idle_{init,start,stop} and uv_check_{init,start,stop} - Upgrade uv_ref/uv_unref from no-ops to real ref/unref - Add uv_has_ref, uv_is_active, uv_is_closing, uv_os_getpid - Extend uv_close to handle timer/idle/check types - Fix event loop re-wake: add UvLoopInner::needs_poll() to wake promptly for timers/idle/check without hot-looping for TCP/TTY handles - Add NAPI tests for all new functionality Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Parents
Loading