Skip to main content

enqueue

Function enqueue 

Source
pub async fn enqueue(
    pool: &Pool,
    msg: &Notification,
    source_id: i64,
) -> Result<usize, ExecError>
Expand description

Queue msg for every enabled target subscribed to its event.

Returns how many rows were written. Cheap and synchronous — one SELECT and N INSERTs — so it is safe on a request path; the network calls happen in drain.

§Errors

Driver / query failures. Callers on a visitor-facing path should log and carry on rather than fail the submission: the content is already saved, and losing the notification is better than losing the lead.