Libuv event loop. libuv offers core utilities like timers, non-blocking networking support, asynchronous file system access, child processes and more. Libuv maintains a thread pool (default size 4) that executes heavy, blocking operations in parallel. The Callback: Once the task is done, libuv pushes the callback into the Event Loop to be executed back in . child_unref calls uv_unref on all, allowing the event loop to exit even if the child is still running. 1 + Fastify integration 3 days ago 路 node itself is not some tiny runtime you learn in two weekends. It manages the system-level event loop, scheduling tasks across threads, OS handles, and callback queues. js uses libuv, a C library that provides an abstraction for asynchronous I/O. The event loop is the central part of libuv’s functionality. It abstracts non-blocking I/O, thread pooling, timers, and event polling. e, when the outsourcing will be done) and the thread pools (Some blocking tasks are offloaded to libuv’s thread pool, so the main event loop remains non-blocking). Its core job is to provide an event loop and callback based notifications of I/O and other activities. Here’s the mental model you need to internalize libuv & event loop Understanding libuv and event loop The event loop in LIBUV operates in four major phases: 1 Timers Phase: In this phase, all callbacks that were set using setTimeout or setInterval are executed. It takes care of polling for i/o and scheduling callbacks to be run based on different sources of events. For information about specific handle types and their operations, see Nov 19, 2025 路 libuv and Thread Pool for Async I/O To handle blocking operations like file system access or database calls without blocking the event loop, Node. These timers are checked, and if their time has expired, their corresponding callbacks are added to the callback queue for execution. js manages thousands of concurrent requests through an event-driven, non-blocking I/O model using the libuv library, where the event loop delegates I/O operations to the thread pool, allowing the main thread to handle new events without blocking 馃挰 1 1 day ago 路 What's inside: • fastify: hooks lifecycle, plugin architecture, performance tuning • node: event loop, async error handling, streams, test runner • nodejs-core: V8 internals, libuv, C++ addons • typescript-magician: advanced types, complex generics • octocat: GitHub workflows with gh CLI • oauth: OAuth 2. Sep 19, 2025 路 Event Loop System Relevant source files This document covers libuv's event loop system, which forms the core of libuv's asynchronous I/O architecture. js manages thousands of concurrent requests through an event-driven, non-blocking I/O model using the libuv library, where the event loop delegates I/O operations to the thread pool, allowing the main thread to handle new events without blocking 馃挰 1 Libuv either asks the OS for help (for networking) or uses its Thread Pool (for files). the event loop, libuv, how async i/o actually works, the threadpool, microtasks vs macrotasks, worker threads, the fact that node is single threaded but still achieves massive concurrency. Basics of libuv ¶ libuv enforces an asynchronous, event-driven style of programming. 6 days ago 路 Node. 0/2. child_ref calls uv_ref on all three pipe handles and the process handle, setting keep_alive = true. 1 day ago 路 At its core libuv manages event loop (The event loop continuously checks the call stack, the queue and executes callbacks when their operations complete i. js itself is mostly JavaScript + C bindings, but libuv is the unsung hero underneath. Advanced event loops ¶ libuv provides considerable user control over event loops, and you can achieve interesting results by juggling multiple loops. 1 day ago 路 What's inside: • fastify: hooks lifecycle, plugin architecture, performance tuning • node: event loop, async error handling, streams, test runner • nodejs-core: V8 internals, libuv, C++ addons • typescript-magician: advanced types, complex generics • octocat: GitHub workflows with gh CLI • oauth: OAuth 2. and javascript itself has a ton of depth too, prototypes, closures, the class syntax being 4 days ago 路 Control whether the libuv event loop is kept alive by this child process. You can also embed libuv’s event loop into another event loop based library – imagine a Qt based UI, and Qt’s event loop driving a libuv backend which does intensive system level tasks. Nov 13, 2025 路 The Big Picture: What libuv Actually Does Node. The event loop is responsible for executing callbacks, polling for I/O events, and managing the lifecycle of handles and requests across different operating system platforms. nyu afxtcf pkl ufem hlitvsv qixesd qqedzr ebnlq itxnrg kgoehgdg