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.

In more detail

It is the safe way to split long or recursive work, because the event loop handles I/O and timers between immediates. process.nextTick(), by contrast, runs before the loop can move on at all.

Related terms

Taught in

References