I read Nodejs Event Loop and "Event Loop Explained" and Don't Block the Event Loop
I don't think there is a for/while forever loop in nodejs code (js or c++), e.g. as here explains libev event loop http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#EXAMPLE_PROGRAM
int
main (void)
{
// use the default event loop unless you have special needs
struct ev_loop *loop = EV_DEFAULT;
// init
// now wait for events to arrive
ev_run (loop, 0);
// break was called, so exit
return 0;
}
So how does nodejs event loop run forever or maybe there is indeed a for/while forever loop, as https://en.wikipedia.org/wiki/Event_loop pseudo code shows ?
I searched all SO sites and find Is an event loop just a for/while loop with optimized polling?. There are different opinions there, e.g. Bryan Oakley's answer said yes and other said no.
But my question is a little bit different from that one. I was wondering without a for/while loop, how does nodejs event loop keeps running?