allura.model.notification
Manage notifications and subscriptions
When an artifact is modified:
Notification generated by tool app
Search is made for subscriptions matching the notification
Notification is added to each matching subscriptions’ queue
Periodically:
- For each subscriptions with notifications and direct delivery:
For each notification, enqueue as a separate email message
Clear subscription’s notification list
- For each subscription with notifications and delivery due:
Enqueue one email message with all notifications
Clear subscription’s notification list
- class allura.model.notification.Mailbox(*args, **kwargs)
Holds a queue of notifications for an artifact, or a user (webflash messages) for a subscriber. FIXME: describe the Mailbox concept better.
- classmethod deliver(nid, artifact_index_ids, topic)
Called in the notification message handler to deliver notification IDs to the appropriate mailboxes. Atomically appends the nids to the appropriate mailboxes.
- fire(now)
Send all notifications that this mailbox has enqueued.
- classmethod fire_ready()
Fires all direct subscriptions with notifications as well as all summary & digest subscriptions with notifications that are ready. Clears the mailbox queue.
- class allura.model.notification.Notification(*args, **kwargs)
Temporarily store notifications that will be emailed or displayed as a web flash. This does not contain any recipient information.
- classmethod post(artifact, topic, additional_artifacts_to_match_subscriptions=None, **kw)
Create a notification and send the notify message
- classmethod post_user(user, artifact, topic, **kw)
Create a notification and deliver directly to a user’s flash mailbox
- class allura.model.notification.SiteNotification(*args, **kwargs)
Storage for site-wide notification.