🔈 Event Listeners Architecture
Event listeners are the entry point for resync requests. They monitor Port for configuration changes or resync requests.
Types of Event Listeners
- POLLING: Queries Port API at intervals
- KAFKA: Consumes messages from Kafka topic
- ONCE: Runs resync once and exits
Event Listener Flow
When an event listener detects a resync request:
Steps:
- Before Resync: Updates Port with "running" status
- Execute Resync: Calls
sync_raw_all() - After Resync: Updates Port with "completed" status
- On Failure: Updates Port with "failed" status
How Event Listeners Work
Each event listener type implements the BaseEventListener interface and follows this pattern:
- Monitor: Continuously monitors for resync requests (polling, Kafka messages, HTTP requests)
- Detect: Detects when a resync is needed (configuration change, explicit request)
- Trigger: Calls the resync handler (
sync_raw_all()) - Track: Updates Port with the resync status throughout the process
For more details on configuring and using event listeners, see the Event Listener documentation.