Node.js has been causing a lot of buzz around the web.
What is node.js? Why is everyone talking about it?
Briefly, Node is:
- Highly parallel but single threaded
Highly parallel but single threaded
We can’t talk about node without talking about the event loop. The event loop empowers node to be highly parallel and single threaded at the same time.
The event loop will keep spinning as long as theres something to execute. Node is essentially listening for events. When these events occur, node runs the callback function attached to that event. The trick is that only one callback function will execute at any given time. Everything else is handled in parallel. Your code however, will never be executed at the same time as anything else.
Why is everyone talking about it?