|
Class EventFramework::EventFramework
|
|
The EventFramework is a facade designed
to simplify the use of the various components of this event framework. It
automatically creates the event queue, EventProcessor, and EventDispatcher. Users should:
- Optionally register EventGenerators that will be polled by the framework at
regular intervals for Events.
- Optionally register an error handler used when an error occurs during the
processing of an Event.
- Start the event framework and all of its associated components by invoking
the start method.
- Optionally dispatch Events explicitly using the dispatch_event method.
- Stop the event framework and all of its associated components when finished
with the framework.
Creates an instance of the EventFramework
with the specified parameters:
- wait_interval
- An optional parameter specifying the interval (in seconds) that is used to
poll EventGenerators. The default value is 1 second.
Sets an error handler (an EventHandler) to
be used when an error occurs processing an Event.
See EventProcessor documentation for more
information on error handling.
Explicitly dispath an Event into the event
framework for processing. This method can be used in conjunction with the
implicit dispatching of Events via EventGenerators.
- event
- The Event to dispatch on the event queue.
Registers an EventGenerator.
EventGenerators are then polled at regular intervals for Events that are
placed on the event queue. EventGenerators should not be added after the
framework has been started.
- generator
- The EventGenerator to register.
This method is also aliased as
<<
Starts the event framework.
Stops the event framework.