Consider the following elements in an event-driven architecture:
- Observable Object
- Event Dispatcher
Now, we have two messages:
- From Observable Object to Event Dispatcher
- From Event Dispatcher to Observer(s).
How do you decide to pass these messages Sync or Async? Do you use any particular API (in Java) to implement that?
For example, in Java JFC/Swing, the first is Async and the second is Sync. The former is the reason that you can still fire more events even if the program is processing another event. The latter is the reason that you should avoid long operations in your listeners since they block the event dispatcher.