The delivery state of a queued message: its envelope, plus the
Sovite.Queue.Records appended so far, replayed in order.
Each recipient is :pending (never tried), :deferred, :delivered,
or :failed. Final states never change, so a record replayed after a
crash cannot bring a delivered recipient back.
Summary
Functions
Applies one record. Records for unknown recipients are ignored.
Returns true when every recipient is delivered or failed.
Builds the state from an envelope and its records.
Recipients still to be delivered (pending or deferred), in envelope order.
Failed recipients the sender has not been told about, with their details.
Recipients with status, in envelope order.
Types
@type recipient() :: %{ status: :pending | Sovite.Queue.Record.status(), details: Sovite.Queue.Record.details() | nil, notified: boolean() }
The state of one recipient.
@type t() :: %Sovite.Queue.Entry{ attempts: non_neg_integer(), envelope: Sovite.Queue.Envelope.t(), next_attempt: DateTime.t() | nil, recipients: %{required(String.t()) => recipient()}, warned: boolean() }
Functions
@spec apply_record(t(), Sovite.Queue.Record.t()) :: t()
Applies one record. Records for unknown recipients are ignored.
Returns true when every recipient is delivered or failed.
@spec new(Sovite.Queue.Envelope.t(), [Sovite.Queue.Record.t()]) :: t()
Builds the state from an envelope and its records.
Recipients still to be delivered (pending or deferred), in envelope order.
@spec unnotified_failures(t()) :: [{String.t(), Sovite.Queue.Record.details()}]
Failed recipients the sender has not been told about, with their details.
@spec with_status( t(), Sovite.Queue.Record.status() | :pending | [Sovite.Queue.Record.status() | :pending] ) :: [String.t()]
Recipients with status, in envelope order.