check phase
The event loop phase straight after the poll phase, which runs callbacks scheduled with setImmediate.
In more detail
Because it always follows poll, setImmediate inside an I/O callback runs before a zero-delay setTimeout, which has to wait for the next timers phase. That makes setImmediate the dependable way to run code right after the current I/O has been handled.
Related terms
- event loop phase — One of the six stages the Node.js event loop visits in order on every turn: timers, pending callbacks, idle/prepare, poll, check and close callbacks.
- setImmediate() — A Node.js function that runs a callback in the check phase of the current event loop turn, right after I/O has been processed.
- poll phase — The event loop phase that asks the operating system for new I/O events, runs their callbacks, and sleeps when there is nothing to do.
Taught in
- Event Loop Lifecycle: The Six Phases & libuv uv_run — Node.js Internals & Backend Services
- Poll & Check Phases: I/O Callbacks & setImmediate — Node.js Internals & Backend Services