Event loop: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
In [[computer science]], the '''event loop''', '''message dispatcher''', '''message loop''', '''message pump''', or '''run loop''' is a programming construct that waits for and dispatches [[Event-driven programming|events]] or [[Message passing|messages]] in a [[Computer program|program]]. It works by making a request to some internal or external "event provider" (which generally [[blocking (computing)|blocks]] the request until an event has arrived), and then it calls the relevant [[event handler]] ("dispatches the event"). The event-loop may be used in conjunction with a [[Reactor pattern|reactor]], if the event provider follows the [[#File interface|file interface]], which can be selected or 'polled' (the Unix system call, not actual [[Polling (computer science)|polling]]). The event loop almost always operates asynchronously with the message originator.
 
I will change the code When the event loop forms the central [[control flow]] construct of a program, as it often does, it may be termed the '''main loop''' or '''main event loop'''. This title is appropriate because such an event loop is at the highest level of control within the program.
 
==Message passing==