How HermesEventBus works
masterHermesEventBus is an Inter-Process Communication (IPC) library for Android that extends the functionality of GreenRobot's EventBus. While standard EventBus only supports communication within a single process, HermesEventBus enables event posting between multiple processes or even distinct apps.
Architecture Model
The library designates one process as the main process and all others as sub-processes. When an event is posted, the following flow occurs:
- The event is sent via the Hermes IPC framework to the main process.
- The main process uses standard EventBus to post the event locally.
- The main process sends the event via Hermes to all registered sub-processes.
- Each sub-process uses EventBus to post the event locally within itself.
To prevent concurrency issues like deadlocks and race conditions, the library utilizes the Concurrent-Utils library.