Argus
Argus copied to clipboard
Add a notification queue handled by at least one separate background process
The MediumClass.send() static method takes an event and notification profile and **kwargs
. It runs in a new process per event.
The procedure is currently:
- Incident is received.
- NotificationProfiles are checked to see if there should be sent any notifications, signature
NotificationProfile().incident_fits(incident)
. - In the same loop of profiles, a function sends the notification, signature
send_notification(event, profile)
- In the same loop, which notification media are available is checked
- In the same loop, a new loop starts to send to a specific medium
- Return to 1
Instead:
- On startup, which notification media are installed is checked and cached
- Incident/event is received.
- NotificationProfiles are checked to see if there should be sent any notifications. Signature: NotificationProfile.objects.incident_fits(incident)
- The event and media (destination) is put on a queue
- A background/different process reads from the queue and sends the notifications
- Return to 2
This will make it easier to speak to an external notification sender as well. One connection per medium instead of profile x medium connections.
#400 deals with the initial implementation of queuing for this