Event represents a single event that has occurred
at a specific point in time. An EventGenerator typically creates events
which are then placed on the event queue at regular intervals by an EventDispatcher. Alternatively, events can
be explicitly placed on the event queue using the dispatcher. In both
cases, events are then pulled off the queue and processed by an EventProcessor. After an event has been
processed, it should not be injected back into the system (do not reuse
Arbitrary data associated with the event. This is strictly informational
and is not used directly. It is expected that users’ event handlers
will utilize this data when processing the event.
The EventHandler that should be used to
process this event. Any object may used as an event handler so long as it
responds to the handle_event
The originator of the event. This is a strictly informational piece of data
that should be used to identify the object that originated the event. This
value can be a reference to any object. The associated handler may use this
value during the processing of the event.
The time the event was created (not the time it was processed), stored as
an instance of Time.
Creates a new event with the specified arguments:
- The originator of the event
- The data associated with the event
- The event handler used to process this event
Processes the event by invoking the EventHandler associated with this event.
Events are typically processed by an EventProcessor in a separate thread of
execution to avoid interfering with the dispatching of events.
Returns a string representation of the event which includes the time,
originator, as well as any data associated with the event.