# `Ankusa.Dispatch.Replayer`
[🔗](https://github.com/jamescarr/ankusa/blob/ankusa-v0.7.0/packages/ankusa/lib/ankusa/dispatch/replayer.ex#L1)

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)`.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
