Does nextTick means next phase in Node.js (Event Loop)?
Asked Answered
D

1

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 ?

Douce answered 14/5, 2016 at 19:50 Comment(0)
W
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.)

Wentzel answered 14/5, 2016 at 20:1 Comment(1)
setImmediate, during the next tick ! or just in the check phase of the event loop ?Douce

© 2022 - 2024 — McMap. All rights reserved.