An EventProcessor waits for the arrival
of Events on the event queue. As Events are dequeued, they are processed
using the EventHandler associated with the
Event. The EventProcessor runs in a separate thread so
that event dispatching does not adversely affect the processing of events.
If an exception is thrown while processing an Event, it can be caught and processed by an error
handler. The error handler is a regular EventHandler. The Event generated when an error occurs contains an
array of 2 items (the exception and the original event that caused the
exception). This array is available via the data attribute of the Event.
Process an Event from the event queue waiting
(forever possibly) for one to arrive. This method is called repeatedly by a
worker thread. It should be noted that when the worker thread is told to
stop running, it first generates an empty event so this thread will awaken
one final time.