# `BB.Camera.Subscription`
[🔗](https://github.com/beam-bots/bb_camera/blob/main/lib/bb/camera/subscription.ex#L5)

A consumer's handle on a camera's capture.

Holding one does not make frames arrive. Each `BB.Camera.request/1` asks for
exactly one frame, strictly newer than the last one delivered on this
subscription, and at most one request is outstanding at a time. That is what
keeps a consumer's loop running at the camera's rate rather than at the
processor's, and what keeps the hub's memory at one frame regardless of how
slow a consumer is.

`monitor` is the hub's monitor reference. Consumers should match on
`{:DOWN, monitor, :process, _, _}` so a camera that dies surfaces as an error
rather than a wait that never ends.

# `t`

```elixir
@type t() :: %BB.Camera.Subscription{
  camera: atom(),
  hub: pid(),
  monitor: reference(),
  ref: reference(),
  robot: module(),
  stream_info: BB.Camera.StreamInfo.t()
}
```

---

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