Expand description
The kernel’s perception-consumer seam.
The media + AI-task kernel is domain-agnostic: it samples frames, accepts detections from workers,
and persists them. Anything that interprets those detections into domain events — the zone engine
(spatial rules), the ANPR/access-control engine (plate authorization), and other domain
verticals — plug in here as a DetectionConsumer rather than being wired
into the ingest handler or crate::state::AppState directly.
This inverts the dependency: ingest fans a committed batch out to a registry of consumers; a
consumer self-declares which task_types it cares about. New apps are added to the registry (and,
after the crate split, linked in by the composing binary or fed over the event stream) — the kernel
never gains an if task_type == "..." branch.
Structs§
- Detection
Batch - One committed batch of detections handed to consumers after it is persisted. Carries the site/camera/task context so a consumer needs no extra lookups (and so the seam is tenant-aware for distributed deployments).
Traits§
- Detection
Consumer - A pluggable interpreter of detection batches. Implementors live in their own module/crate (zones is
kernel-open; ANPR/entry is a proprietary app) and are registered into
crate::state::AppState.
Functions§
- fan_out
- Drive every interested consumer for one committed batch, AT MOST ONCE per
(consumer, camera_id, frame_id).