- Published on
Event Loop .md file
- Authors
- Name
- Ganesh Negi
Event Loop
The Event Loop is a mechanism that handles asynchronous operations without blocking the other operations.
It Executes JavaScript synchronously first and then process asynchronous operations.
It Delegates the heavy tasks like I/O ioerations, timers and network request to libuv library.
Libuv library is a library which is written in C to handle asynchronous operations.
This library manages a thread pool that offloads heavy tasks like file system, timers and network requests.
Once the thread pool completes its tasks, it sends callbacks to the event queue. The event loop processes the callbacks but only in case of when the call stack is empty.