You known that EventsAreNotCallBacks, therefore you dispatch your events in some EventQueue.
An arbitrary amount of time can elapse between the event queuing and its actual processing. What happens if the event consumer has unregistered itself from the event producer?
Two possibilities:
- You DropOutdateEvents?: if the event consumer is not registered anymore as event listener on the producer, it does not want to receive events anymore, so just drop the event;
- You ProcessOutdatedEvents?: if the event consumer was registered as event listener on the producer at the time the event occurred, that?s because it was interested about events occurring at that time. So just process it.
Personally, it tend to use DropOutdateEvents
?, this is much more easy to handle (once you called removeListener, you can be sure that the
eventOccured method is not called anymore), but this can lead to information loss.
-- PhilippeDetournay
Related: EventsAreNotCallBacks, GuiThread
CategoryEvents