# `PhoenixReplay.Export.Queue.Local`
[🔗](https://github.com/elixir-vibe/phoenix_replay/blob/v0.6.2/lib/phoenix_replay/export/queue/local.ex#L1)

The default `PhoenixReplay.Export.Queue`: keeps video exports in memory
and runs them under `PhoenixReplay.Export.TaskSupervisor`,
`:max_concurrency` at a time, on the node that asked for them. They are
lost when the node stops; `PhoenixReplay.Export.Queue.Oban` keeps them.

It keeps every job until its video is `:ttl` old, broadcasts each change
to a job on the recording's topic, and deletes expired videos. A job
whose task crashes fails, and the next one starts. When it starts, and
every quarter of `:ttl` from then on, it deletes the videos and
screenshots in the export directory older than `:ttl`: those a server
that stopped left, so they do not pile up across deploys, and those of
exports another queue, such as `PhoenixReplay.Export.Queue.Oban`,
rendered on this node. Other files there are left alone, so `:dir` may be shared.

Cancelling a queued job takes it out of the queue. A running one is sent
`{PhoenixReplay.Export, :cancel}` rather than killed, so it closes its
browser and stops ffmpeg itself, and ends with `{:error, :cancelled}`.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Starts the export queue, registered under this module's name.

---

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