An EventHandler specifies how an Event should be processed. Every Event contains a single EventHandler which is executed upon
consumption from the event queue by the EventProcessor. The EventHandler contains the business logic that
is used to process the Event.
Users are expected to either create their own subclasses that override the
handle_event method. Alternatively,
users can pass a block as part of the constructor. The block will be
executed when handle_event is
Creates an EventHandler. If a block is
provided, it will be executed upon each invocation of handle_event. This provides a very
simple means to creating handlers. The block will be passed the Event which is being handled.
Processes an Event. This method should be
overridden by a concrete implementation. Alternatively, if a block was
supplied to the constructor of the EventHandler, it will be executed to process
If this method returns true and this handler is part of a chain
(see ChainEventHandler), subsequent
handlers will be permitted to process the event; otherwise, subsequent
handlers are prevented from processing the Event.
- The Event to be processed.
Returns a string representation of the EventHandler which is simply the name of the