A program's main control loop. This loop contains an event queue, an event dispatcher, and one or more ways to create new events. see: event queue, dispatch, main loop, resource, resource watcher
In computer science, the event loop, message loop or message pump is a programming construct that waits for and dispatches events or messages in a program. It works by polling some internal or external "event provider", which generally blocks until an event has arrived, and then 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 select()ed or poll()ed).