Event Loop

In computer science, the event loop, message dispatcher, message loop, message pump, or run loop is a programming construct that waits for and dispatches events or messages in a program. It works by making a request to some internal or external "event provider" (which generally 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, if the event provider follows the file interface, which can be selected or 'polled' (the Unix system call, not actual polling). The event loop almost always operates asynchronously with the message originator.

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.

Read more about Event Loop:  Message Passing, Alternative Designs, Usage, File Interface

Famous quotes containing the word event:

    When we awoke, we found a heavy dew on our blankets. I lay awake very early, and listened to the clear, shrill ah, te te, te te, te of the white-throated sparrow, repeated at short intervals, without the least variation, for half an hour, as if it could not enough express its happiness. Whether my companions heard it or not, I know not, but it was a kind of matins to me, and the event of the forenoon.
    Henry David Thoreau (1817–1862)