Notifier Sender Job
The NotifierSender is the communication bridge of the daemon. It monitors the earthquake_event signal and sends instant alerts to external services using the Apprise library. Beyond simple text alerts, it generates and attaches interactive HTML waveforms of the detected event.
Architecture & Lifecycle
Section titled “Architecture & Lifecycle”The Notifier maintains a high-resolution rolling buffer to ensure that when an alert is sent, the user sees what happened before the trigger as well as after.
- Input:
notifier_queue(Continuous 100 Hz stream for buffering). - Trigger:
earthquake_event(from the Trigger Processor). - Output: Multi-channel notifications via Telegram, Discord, Email, or Slack.
Event Handling Logic
Section titled “Event Handling Logic”When an earthquake is detected, the Notifier follows a strict timing sequence to capture the full waveform.
- Pre-Event Buffering: The thread constantly keeps the last 60 seconds of data in a
dequebuffer. - Immediate Alert: As soon as
earthquake_eventis set, a text-only “Initial Alert” is sent to the user (e.g., via Telegram). - Post-Event Collection: The thread waits another 60 seconds to capture the earthquake.
- Report Generation: A 120-second interactive plot (60s pre + 60s post) is generated using Plotly.
- Final Delivery: The interactive HTML report is sent as an attachment to the existing alert thread.
Configuration
Section titled “Configuration”The Notifier uses Apprise URLs, allowing you to swap notification services without changing code.
jobs_settings: notifiers: - url: "tgram://{bot_token}/{chat_id}/" enabled: true