Event loop
Software loop that processes events
Software loop that processes events
In software, an event loop is an algorithm that continually dispatches control flow for events. The loop requests the next event from an event provider (which generally blocks the loop until an event occurs), and when an event is received, invokes its associated event handler. When the event loop is the central event dispatcher of a program, as it often is, it is called the main loop or main event loop. In modern environments such as web browsers and server runtimes, the event loop is a fundamental mechanism that enables asynchronous execution by continuously monitoring and dispatching events or messages from a queue when the main program thread is idle. In JavaScript, the event loop allows non-blocking handling of tasks such as user interactions, timers, and I/O operations despite the language being single-threaded. The same algorithm can be used to process inbound messages, a superset of events. In this context, the algorithm is called a message loop, message dispatcher, or message pump...
Open boosters, collect cards and trade them. Free to play.
Play for free