3 ms·
Node.js is asynchronous, not Non-blocking. Don't use the two interchangeably, because they aren't interchangeable. Not understanding this leads to pain and suf
by drakaal 13y ago
Node.js is asynchronous, not Non-blocking. Don't use the two interchangeably, because they aren't interchangeable.
Not understanding this leads to pain and suffering on a massive scale.
- buckbova 13y agoIt is described as non-blocking by almost everyone. If untrue, please tell me why. http://nodejs.org/ http://nodejs.org/ > Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
- drakaal 13y agoYou wake up in the morning and say, "I wish I had a Samsung Galaxy S5". Async: you tell your personal assistant to go get you one. You continue your day, eat breakfast, build a shrine to hold your new phone and he comes back and says "they were out, I'm sorry, do you want me to go back and get an iPhone instead?" Non-Blocking: you try to click the buy it now on Amazon and it says, "Out of stock. Would you like to order and have fulfilled when back in stock?" you click yes. You eat breakfast, write the next Flappy Bird, and get actual work done. 4 days later it comes back in stock and your new phone arrives. If you missed the difference, Async, is "fire and check back later". Non-blocking is "error instantly, Perform later or in parallel". There are other differences but this is an easy analogy, that shows how the two are not synonyms.
- deleted 13y ago[deleted]
- briantakita 13y agoI don't know what @drakaal is trying to say, but here is the wikipedia page on non-blocking algorithms. http://en.wikipedia.org/wiki/Non-blocking_algorithm http://en.wikipedia.org/wiki/Non-blocking_algorithm Node.js is said to run an a single-threaded "non-blocking" event loop. Whenever i/o is performed, you give a callback which is invoked when the i/o is completed, either with success or error.
- deleted 13y ago[deleted]