asynchronous I/O
Starting an input or output operation and carrying on with other work, being told later, usually through a callback or promise, when it has finished.
In more detail
This lets one Node.js thread serve thousands of connections, because it never sits idle waiting for a single one. The results come back as events handled by the event loop.
Related terms
- I/O — Input and output: any time a program reads or writes data outside its own memory, such as files, networks or the terminal.
- blocking I/O — An operation that makes the program stop and wait until it finishes, so nothing else on that thread can run meanwhile.
- 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.
- callback — A function you pass to other code so it can call you back later, for example when an event happens or a timer fires.
Taught in
- libuv Architecture: Event Demultiplexer & Thread Pool — Node.js Internals & Backend Services
- Event Loop Lifecycle: The Six Phases & libuv uv_run — Node.js Internals & Backend Services
- Asynchronous File I/O: node:fs/promises & Handles — Node.js Internals & Backend Services