DripDrop.Policy.AdapterPause (DripDrop v0.1.0)

Copy Markdown View Source

Defers dispatch when a channel adapter has been paused by the bounce/complaint threshold checker.

DripDrop.Policy.BounceComplaintThresholds writes paused_until and paused_reason into channel_adapters.config when an adapter's rolling rates breach the configured limits. This module is the read-side that actually blocks dispatch through such an adapter until the cooldown expires.

Stale or unparseable paused_until values are treated as "not paused" (logged via telemetry) so a corrupted config field cannot wedge dispatch.

Summary

Functions

Returns :ok for unpaused adapters, {:defer, defer_until, metadata} for adapters whose paused_until is in the future.

Functions

check(context, adapter)

@spec check(map(), map()) :: :ok | {:defer, DateTime.t(), map()}

Returns :ok for unpaused adapters, {:defer, defer_until, metadata} for adapters whose paused_until is in the future.