What happens in the poll phase of the event loop?
The event loop retrieves new I/O events and executes I/O-related callbacks. If there are no timers scheduled and no pending callbacks, it blocks here waiting for events. This is where most I/O callbacks run.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in libuv Event Loop Phases Explained: Timers, Poll, Check, and Close
Timers (setTimeout and setInterval callbacks), pending callbacks (deferred I/O callbacks), idle/prepare (internal), poll (new I/O events and I/O callbacks), check (setImmediate callbacks), and close callbacks (cleanup for closed resources).
Callbacks scheduled by setTimeout and setInterval run. The event loop checks if any timer's threshold has been reached and runs those callbacks. This is the first phase of each loop iteration.
Callbacks scheduled by setImmediate run. setImmediate runs after the poll phase, making it useful for running code right after I/O events are processed.
Still have questions?
Browse all our FAQs or reach out to our support team
