CS Listener Architecture
The main process is as follows:
Registration operation: The clients client1, client2, client3, and client4 register themselves and the CSKey they want to monitor with the csserver through HTPP requests. The Service service obtains the callback engine instance through the external interface, and registers the client and its corresponding CSKeys.
Heartbeat mechanism:
All clients use heartbeat information to detect whether the value of CSKeys in ContextKeyCallbackEngine has changed.
ContextKeyCallbackEngine returns the updated CSKeys value to all registered clients through the heartbeat mechanism. If there is a client’s heartbeat timeout, remove the client.
Listener UM class diagram
Interface: ListenerManager
External: Provide ListenerBus for event delivery.
Internally: provide a callback engine for specific event registration, access, update, and heartbeat processing logic