A fourth event, likewise fixing in and by itself a location in spacetime, is the strike of a lightning bolt on the rudder of an airplane. Note that events also afford a natural way of implementing concurrency. 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.