Event loop
Programming design pattern that waits for and dispatches events or messages in a program
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.
Nº Q1349935 ★
Common · Knowledge
Event loop
Programming design pattern that waits for and dispatches events or messages in a program
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.
Last price
—
Floor price
—
7-day median
—
30-day sales
0
30-day range
—
In circulation
0
Price history
median
low – high
sales
No sales in this period
Show table
| Date | median | Low | High | sales |
|---|
Sales history
- Last sale
- —
- 30-day average
- —
- 30-day low
- —
- 30-day high
- —
- Sales 7d
- 0
- Sales 30d
- 0
No sales yet.
Anonymous sales: no buyer or seller shown. Figures count player-to-player sales only.
From Wikipedia
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. A common use for a message loop is message passing inter-process communication where the message queue is maintained outside of the program (such as by the operating system). Typically, a program that operates in a graphical user interface (GUI) environment uses an event loop, and due to the predominance of GUI environments, most modern applications have a main event loop. In the following pseudocode, get_next_message() is a placeholder for a function that is typically provided by the operating system that blocks until a message is available. Thus, the loop only repeats when there is a message to process. loop message := get_next_message() process_message(message) while message != quit
Text: Wikipédia, CC BY-SA 4.0. ·
Related cards
-
E
Event (computing)
Computing operation that can be recognized and handled by software
Nº Q3291944 ★
Not listed
-
R
Reactor pattern
Event handling pattern for handling service requests delivered concurrently to a service handler by one or more inputs; the service handler then demultiplexes the incoming requests and dispatches them synchronously to the associated request handlers
Nº Q1122024 ★
Not listed
-
A
Async/await
A syntactic feature of programming languages that allows for asynchronous, concurrent programming
Nº Q16245951 ★
Not listed
-
E
Event Viewer
Component of Microsoft's Windows operating system
Nº Q360204 ★
Not listed
-
S
Syslog
Network event logging system and protocol
Nº Q1425501 ★★
Not listed
-
C
Control flow
Order in which individual statements, instructions or function calls of an imperative program are executed or evaluated
Nº Q868299 ★★
Not listed