NodeJS - Event Loop unveiled


NodeJS : An asynchronous single threaded environment 😮

When started to work with nodeJS i was surprised that it was advertised as "asynchronous single threaded" environment.

So I've tried to understand how it worked and then, at the end, I have dealt with famous and notorious event loop. Moreover, during studying, I've also figured out that its operation was the same either when Javascript run in NodeJS than in the whatever Internet Browser.

The Event Loop

In the image below has shown the basic event loop schema that make clear the architectural choices behind  the callback model (and as consequence the callback hell).
In fact such model allows to decouple the event loop thread, where the main application runs, from all the resource consuming operations.

Basic Event Loop Schema

Event Loop in NodeJS

The image below adds more details to the previous one in particular, concerning event loop, we find out event queue and worker threads that give us a bit more info about its operation.


NodeJS System


What the heck is the event loop anyway?

If you are interested to better understand event loop operation I recommend you to take a look to the following video.

Really this video has inspired such article and it will give you a very clear understanding of all I've briefly explained before ...

So... enjoy this amazing video 😉


   
 Philip Roberts: What the heck is the event loop anyway? | JSConf EU 2014



Comments

  1. It was really a nice post and I was really impressed by reading this
    Node JS Online training
    Node JS training in Hyderabad

    ReplyDelete
  2. Thanks for sharing this...
    Leanpitch provides online training in Scrum Master during this lockdown period everyone can use it wisely.
    Scrum Values

    ReplyDelete
  3. Thanks for sharing this informative content , Great work
    Leanpitch provides online training in Advanced Scrum Master during this lockdown period everyone can use it wisely.
    Advanced Scrum Master Training Online

    ReplyDelete
  4. sugarboo extra long digital titanium styler
    Ingredients · titanium damascus 1 cup Sugar titanium damascus knives · 1. Hot pepper titanium hair trimmer powder titanium vs ceramic flat iron · 2 teaspoons Salt · 3 titanium sheet metal tablespoons Sugar · 1 cup

    ReplyDelete
  5. Great information Thank you

    ELearn Infotech offers Real-time Node JS Training in Hyderabad. Our Node JS course includes from Basic to Advanced Level Node JS Concepts. We have designed our Node JS course content based on students Requirement to Achieve Goal. We offer both Node JS class room training in Hyderabad and Node JS Course online training by 10+ years Realtime Experts.

    ReplyDelete

Post a Comment

Popular posts from this blog

Google Web Toolkit Vs AngularJS

PlantText: The new "Online" UML Editor powered by PlantUML

PlantUML & Maven - Enrich your project's documentation