+1 vote
in NodeJS Essentials by

What is process.nextTick()

1 Answer

0 votes
by

setImmediate() and setTimeout() are based on the event loop. But process.nextTick() technically not part of the event loop. Instead, the nextTickQueue will be processed after the current operation completes, regardless of the current phase of the event loop.

Thus, any time you call process.nextTick() in a given phase, all callbacks passed to process.nextTick() will be resolved before the event loop continues.

Related questions

+1 vote
asked May 31, 2020 in NodeJS Essentials by Robindeniel
+1 vote
asked May 31, 2020 in NodeJS Essentials by Robindeniel
...