# `PhoenixReplay.Session.Flusher`
[🔗](https://github.com/elixir-vibe/phoenix_replay/blob/v0.6.2/lib/phoenix_replay/session/flusher.ex#L1)

Writes a running session's buffered events to storage as one chunk.

Runs in a task started by `PhoenixReplay.Session.Monitor`, which flushes
each session at most once at a time, so a session's chunks are written in
order by one process. The chunk is redacted with the session's
`PhoenixReplay.Redactor` before it is written, then its events leave the
buffer, keeping memory bounded however long the session runs.

# `flush`

```elixir
@spec flush(PhoenixReplay.Recording.id()) :: :ok | {:error, term()}
```

Flushes the buffered events of session `id`.

---

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