Argus icon indicating copy to clipboard operation
Argus copied to clipboard

Add a notification queue handled by at least one separate background process

Open hmpf opened this issue 2 years ago • 1 comments

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:

  1. Incident is received.
  2. NotificationProfiles are checked to see if there should be sent any notifications, signature NotificationProfile().incident_fits(incident).
  3. In the same loop of profiles, a function sends the notification, signature send_notification(event, profile)
  4. In the same loop, which notification media are available is checked
  5. In the same loop, a new loop starts to send to a specific medium
  6. Return to 1

Instead:

  1. On startup, which notification media are installed is checked and cached
  2. Incident/event is received.
  3. NotificationProfiles are checked to see if there should be sent any notifications. Signature: NotificationProfile.objects.incident_fits(incident)
  4. The event and media (destination) is put on a queue
  5. A background/different process reads from the queue and sends the notifications
  6. 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.

hmpf avatar Mar 04 '22 11:03 hmpf

#400 deals with the initial implementation of queuing for this

lunkwill42 avatar Apr 14 '23 10:04 lunkwill42