Drawback of mixing Blocking and Non-Blocking Code
When doing multiple operations we may come across a situation where we accidentally combine blocking and non blocking operations which may lead some operations to execute even before their required operations are not completed. For example, if a file content is printed on the console even before the file has been read. To overcome this situation it is always preferred to write non-blocking code for related functions.
Blocking and Non-Blocking in Node
Node is based on an event-driven non-blocking I/O model. This article discusses what does Blocking and Non-Blocking in Node means.
Table of Content
- What is Blocking?
- What is Non-Blocking ?
- How Concurrency and throughput is handled?
- Drawback of mixing Blocking and Non-Blocking Code