uv_run
The libuv function that runs the event loop, going round its phases until no active handles or requests remain.
In more detail
Node.js calls it once your main script has run. When it returns, the process emits beforeExit and, if nothing new was scheduled, exits.
Related terms
- libuv — The C library inside Node.js that runs the event loop, performs asynchronous I/O and manages the thread pool.
- event loop — The central loop of an asynchronous program that waits for events, such as timers firing or data arriving, and runs the matching callbacks.
- libuv handle — A libuv object representing a long-lived resource such as a timer, socket or server; while active ones remain, the event loop keeps the process alive.
Taught in
- Event Loop Lifecycle: The Six Phases & libuv uv_run — Node.js Internals & Backend Services