BB.Camera.Subscription (bb_camera v0.1.1)

Copy Markdown View Source

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.

Summary

Types

t()

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