A program can set up multiple event handlers to deal with different things happening independently, and these event handlers can operate in different threads concurrently. Also, since the program does not waste cycles busy-probing, the program itself is free to do other useful things. A Simple but Useful Model Event-oriented programming provides a simple model for component interaction that is useful for distributed control problems such as resource reservation and allocation. Sources announce events, and listeners subscribe for event notification. Event listeners register with one or more sources or adapters to receive events from them.
Event sources each maintain a list of listeners.
Events are sent to listeners by calling an individual method on each listener. Event adapters can behave as event listeners or as event sources as needed. They can subscribe on other sources' event lists, and they can maintain event lists to send events to other listeners by calling an individual method on each listener. Applied Delegation Adapters are often employed as intermediary event listeners that can reside between event sources and the event listeners that actually want to act on the events generated. Adapters themselves can be chained compositionally, setting up customizable event-triggering networks.