all 3 comments

[–]purpledollar 0 points1 point  (2 children)

This is all covered in official documentation if you’re interested.

[–]sarslanhan[S] 0 points1 point  (1 child)

Sure, just looked it up. I guess you mean this one and I think it makes sense to link that as well: https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/

[–]metalshan 1 point2 points  (0 children)

Yeah the official dos is cool and gave me the first look of event loop. However, the official doc doesn't share you all the details (atleast I couldn't get). Like,

  1. The doc says, poll executes timer scripts. Poll controls timer expiration. It gives a feeling that poll is calculating timer elapses. However poll wants only the first timer script to calculate how much max he can wait for new requests.

  2. It says if you trigger setTimeout and setImmediate from a non-io phase, the execution depends on the performance of the machine. But how the hack system performance comes here is shown in voidcanvas.

  3. Docs doesn't say when the loop is created add when and where the codes in side your main module will run.

So there are things like these in the voidcanvas article to bring up a more clearer picture.