# `SuperPi.Durable.DeferredFlusher`
[🔗](https://github.com/oleksandr/super-pi-beam/blob/v0.1.0/lib/super_pi/durable/deferred_flusher.ex#L1)

Implements `pi-durable` deferred commit batching (`REQ-DUR-04`, `REQ-DUR-05`).

Streaming partial tokens and tool stdout commit to `:ets` every `100ms` so UI watchers see
instant updates, and flush to SQLite/PostgreSQL lazily within `1000ms` or piggyback on the
next immediate commit.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `ensure_pending_ets!`

# `flush_now!`

Flushes all pending deferred ETS updates to Ecto immediately (`REQ-DUR-05`).
Safe to call inside or outside an existing Ecto transaction.

# `pending_count`

# `stage_deferred`

Stages a deferred document update in ETS immediately (`100ms` memory path) and schedules
a lazy database flush within `persist_within_ms` (default `1000ms`).

# `start_link`

---

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