Dual-checkpoint policy engine for delivery suppression decisions.
Call evaluate/2 at two points in the dispatch pipeline:
- Planning time (before dispatch): pass
opts: []— checks channel preference only. - Perform time (inside dispatcher, after delivery loaded): pass
check_read_state: delivery.delay_fallback.
Returns:
{:ok, :proceed}— delivery should proceed to the adapter.{:suppress, reason_atom}— delivery should be suppressed.reason_atomis a plain atom (:channel_disabled,:already_read). Persist asAtom.to_string(reason_atom)on the delivery row.
The built-in channel-preference and read-state checks are the complete policy surface. Host applications should apply additional policy before invoking the Chimeway dispatch boundary.
Summary
Functions
Evaluates delivery policy and returns a proceed or suppress decision.
Functions
@spec delivery_category(Chimeway.Delivery.t()) :: String.t() | nil
@spec evaluate(Chimeway.Delivery.t(), keyword()) :: {:ok, :proceed} | {:suppress, atom()} | {:defer, map()}
Evaluates delivery policy and returns a proceed or suppress decision.
Options:
check_read_state:(boolean, default false) — when true, checks if the associated in-app notification has been read (read_at is not nil). Used for delayed fallback paths.