0

What does process.nextTick exactly mean ?

Does nextTick mean, after callback queue pop for one element in the current phase ? Or before moving to the next phase after executing all callbacks in the current phase's queue ?

faressoft
  • 19,053
  • 44
  • 104
  • 146

1 Answers1

0

This is described in the documentation.

nextTick queues callbacks to be invoked at the end of the current tick. The entire queue is emptied before moving to the next tick.

Contrast with setImmediate, which queues callbacks to be invoked during the next tick.

(Yes, the names are misleading, but their behavior is that way to keep compatibility.)

josh3736
  • 139,160
  • 33
  • 216
  • 263