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

Where video exports wait their turn and run.

`PhoenixReplay.Export.Queue.Local`, the default, keeps them in memory on
the node that asked for them. `PhoenixReplay.Export.Queue.Oban` keeps
them in your Oban queue, so they survive restarts and run on any node
of a cluster. The `:queue` option of `:export` chooses one: a module, or
`{module, opts}`.

Either way, every change to a job is broadcast with `broadcast/1`, so
`PhoenixReplay.Export.subscribe/1` follows jobs from either.

# `t`

```elixir
@type t() :: {module(), keyword()}
```

A queue module and its options.

# `cancel`

```elixir
@callback cancel(PhoenixReplay.Export.Job.id(), keyword()) :: :ok
```

Cancels the job with `id`, if it is queued or running. A running one is
asked to stop, and ends `:cancelled`.

# `get`

```elixir
@callback get(PhoenixReplay.Export.Job.id(), keyword()) ::
  PhoenixReplay.Export.Job.t() | nil
```

The job with `id`, if it is still kept.

# `latest`

```elixir
@callback latest(PhoenixReplay.Recording.id(), keyword()) ::
  PhoenixReplay.Export.Job.t() | nil
```

The latest job for a recording, if one is kept.

# `start`

```elixir
@callback start(
  PhoenixReplay.Recording.id(),
  PhoenixReplay.Config.t(),
  PhoenixReplay.Export.Options.t(),
  keyword()
) :: {:ok, PhoenixReplay.Export.Job.t()}
```

Queues an export of a recording, unless one is queued or running, which
is returned instead.

# `broadcast`

```elixir
@spec broadcast(PhoenixReplay.Export.Job.t()) :: :ok
```

Tells subscribers of the job's recording that it changed. Nobody may be
listening, and the export goes on either way.

# `of`

```elixir
@spec of(PhoenixReplay.Config.t()) :: t()
```

The queue `config` exports through.

# `subscribe`

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

Subscribes the caller to the jobs of a recording; see `broadcast/1`.

---

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