Ankusa.Dispatch.Replayer (ankusa v0.7.0)

Copy Markdown View Source

Durable, paced replay jobs over the delivery rows.

A job (Ankusa.Replay) re-sends either dead rows (kind: :dlq) or archived hooks (kind: :archive), or releases hooks held in the quarantine pen that now pass verification (kind: :quarantine), or re-emits lifecycle events from the audit trail (kind: :lifecycle; those go to the lifecycle sinks through Ankusa.Lifecycle.Publisher, and the job moves its cursor when the publisher reports a page delivered). It never bulk-flips rows: once a tick it drips up to rate rows into the existing due index, and only while the Pipeline's oldest-due lag is at most the job's max_lag_ms and its in-flight window is not full — so a replay only uses dispatch capacity live traffic leaves free, and inherits retries, the DLQ, claim check and at-least-once bookkeeping from the Pipeline untouched.

Every job is durable: its record (id, filter, rate, state, cursor, counters) lives in the store, and the cursor is written in the same batch as the rows it moved, so a restart resumes from the last committed page and no row is skipped or doubled by the engine itself (a crash between dispatch claims and their outcomes redelivers, which at-least-once allows).

Started in the :dispatch failure domain next to the Pipeline (Ankusa.Instance), registered as Ankusa.via(instance, :replayer).

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)