1

Can anyone explain to me
@nodejs
Event Loop in two lines ? or a perfect diagram?

Comments
  • 5
  • 0
    This is what I didn't want because none of them is right .....
  • 5
    Asking for a perfect diagram or a two line answer will get you that kind of answer as it sounds like a homework question.

    That said, event loop basically is a loop pulling and handling events one at a time.

    In node, all requests are put in a queue and the event loop processes them one by one.

    Thats why you do mot want to put any heavy processing in the main method, and need to use async for any blocking operation or the server will stall and could lock up.
  • 2
    while(true){
    nextTick(); }
  • 1
    Downvooted.
  • 1
  • 1
    @Voxera Thanks for correcting me and providing the required answer.....
Add Comment