Skip to main content

Module store

Module store 

Source
Expand description

Pluggable QueueStore trait + an in-memory reference impl. Storage abstractions for the outbound queue.

The bundled DeliveryWorker is currently Postgres-only (enabled with the pg feature). This module defines the traits a v1.x-compatible custom worker would target. External users who don’t want sqlx can disable the pg feature, implement QueueStore and Notifier against their own backend (sqlite, sled, custom REST, in-memory for tests), and reuse the pure delivery primitives in this crate (dkim_sign, dsn, mta_sts, retry) plus mailrs-smtp-client.

Wider trait coverage and a generic worker are planned for a future minor release.

Structs§

InMemoryNotifier
In-process notifier backed by tokio::sync::Notify.
InMemoryQueueStore
Pure in-memory QueueStore for tests and single-process pilot deployments. Not durable across restarts.
NoopNotifier
Notifier that drops every signal. The worker still polls on its configured interval, just without fast wake-ups. Useful when a real notifier hasn’t been wired up yet.

Enums§

StoreError
Error returned by store operations. Backend-specific details are stringified to keep the trait dyn-compatible across implementations.

Traits§

Notifier
Cross-process wake-up channel. The submitter calls notify after enqueue; the worker awaits wait to short-circuit its poll interval and pick up new work immediately.
QueueStore
The persistent store the outbound queue lives in.