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 ?
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 ?
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.)
© 2022 - 2024 — McMap. All rights reserved.