Node.js Tutorials - 44 - Timer Queue

preview_player
Показать описание

📱 Follow Codevolution

Timer Queue
Рекомендации по теме
Комментарии
Автор

I just wanted to drop a comment in here to let you know your explanation of the even loop in the last few videos have been extremely digestible. I feel as though I have learned a great deal. Thanks a bunch !

Matt-yzsg
Автор

I really appreciate your efforts and the way you are teaching is awesome 👍

just_a_living_being
Автор

Sir, in video 42, you mentioned that all callbacks in the timer queue are executed first, followed by a check for the micro task queue. Nevertheless, with the help of this example, I grasped the exact point. As a continuation of this playlist, I believe it is not a significant issue

nandakumart
Автор

In the eg-1, We have Promise as well as next tick. We knows that, next tick has higher priortiy than promises. Second next tick callback create any next tick cb. Then, before execute the 3rd promise CB. The next tick created by second Promise should run right. Or Microtask queue execution is something diff from other other queues.

AroFranklin-zl
Автор

Superb content really enjoyed each and every video till now, keep posting really appreciate it.

vaibhav
Автор

in the Microtask tutorial you said that all callbacks within the timer queue are executed which means that the setTimeout 3 should been executed before the nextTick

mohamedibrahimmostafa
Автор

Just superb. Learnt a lot from your videos. I'm just waiting for in depth (Latest) Nest course.

onrightside
Автор

You mention that the setTimeout queue is actually a min heap vs a queue. Is that the case for the other queues or only for setTimer?

DrClean
Автор

One question. What happens with promises returned by I/O operations? Do they get in promise microtask queue or I/O queue?

THEBEST-lhpq
Автор

Great explanation with visualization, thank you for your videos.

WinchesterD
Автор

Not sure for what use case I am asking this but is it possible to override the hierarchy for processing callbacks?

PM-rste
Автор

4:27 when promise #2 adds the nextTick callback while the 3rd promise callback is still in the queue, why doesn't the nextTick callback take precedence there?

CeezGeez
Автор

thanks for this tutorial, after this please do express.js tutorial.

mashrd
Автор

How are callbacks like setTimeout handled in Node.js? Do they initially go to the call stack or are they saved in memory before being executed by the timer module? you showed these go initally to stack then moved to queue

agxxyz
Автор

How setTimeout is being used in node js, since it is part of WEB APIs ?

guruprasadp
Автор

You said that the "timer queue" is actually a min heap, not a queue. So why do they implement it by heap, instead of queue? What is the benefit in this case?

trungnguyentrinhquang
Автор

But with the promises and nextTick you mentioned that our control was still in promise queue then after nextTick console was printed but here nextTick queue is given preference when it's callback was present in setTimeout . So confusing man.😅

mazharimam
Автор

Also, please explain setTimeout with zero delay vs setImmediate

Wakkyguy
Автор

If I put 500, 1000 and zero in the last experiment, display 2, 3, 1 -- don´t do FIFO order.. What I missed?

ytrnn
Автор

In the previous video, if I move the Promise before the nextTick, the nextTick will not run before the Promise. Can someone explain why?

Promise.resolve().then(() => {
console.log(`this is Promise.resolve 1`);
});
Promise.resolve().then(() => {
console.log(`this is Promise.resolve 2`);
process.nextTick(() => {
console.log(`this is Promise.resolve in process.nextTick`);
});
});

Promise.resolve().then(() => {
console.log(`this is Promise.resolve3`);
});

process.nextTick(() => {
console.log(`this is process.nextTick 1`);
});
process.nextTick(() => {
console.log(`this is process.nextTick 2`);
process.nextTick(() => {
console.log(`this is process.nextTick in process.nextTick`);
});
});

process.nextTick(() => {
console.log(`this is process.nextTick3`);
});

// Result
/**
* this is Promise.resolve 1
* this is Promise.resolve 2
* this is Promise.resolve3
* this is process.nextTick 1
* this is process.nextTick 2
* this is process.nextTick3
* this is Promise.resolve in process.nextTick
* this is process.nextTick in process.nextTick

*/

trungphamvan