Eseményhurok
Eseményhurok, a Hungarian term, translates to "event loop" in English and refers to a programming construct that waits for and dispatches events or messages in a program. It is a fundamental concept in asynchronous programming, particularly prevalent in environments like web browsers (JavaScript) and Node.js. The event loop continuously checks for incoming events from various sources, such as user interactions (clicks, keyboard input), network responses, timers, and I/O operations. When an event occurs, the event loop places it in a queue. It then processes these events one by one from the queue, executing the associated callback functions or handlers. This mechanism allows a single thread to handle multiple operations concurrently without blocking the main execution flow. If an operation is time-consuming, like fetching data from a server, it can be initiated, and the event loop can proceed to handle other events while waiting for the operation to complete. Once the operation finishes, its callback is added to the event queue to be processed later. This non-blocking nature is crucial for creating responsive and efficient applications, especially in user interfaces and server-side applications dealing with many simultaneous connections.