O'Reilly logo

The Node Craftsman Book by Manuel Kiessling

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Blocking and non-blocking operations

From the understanding of this conceptual model, we can get to understanding the difference between blocking and non-blocking operations.

The key to understanding these is the realization that every synchronous operation results in a blocking operation. That's right, even an innocent console.log('Hello World'); results in a blocking operation  while the Node.js process writes the text to the screen, this is the only thing that it does. There is only one single piece of JavaScript code that can be executed within the event loop at any given time.

The reason this doesn't result in a problem in the case of a console.log() is that it is an extremely cheap operation. In comparison, even the most simple IO ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required