pub struct AppSpec {
pub name: AppName,
pub broadcast_capacity: usize,
pub gop_capacity: usize,
pub gop_byte_capacity: usize,
pub subscriber_max_lag: Option<u64>,
}Expand description
Plain-Rust application descriptor — a named namespace of streams with its own
fan-out capacity and GOP-replay policy. Build one fluently and register it via
EngineBuilder::application.
use arcly_stream::prelude::*;
let live = AppSpec::new("live")
.gop_cache(120) // ~4s at 30fps → instant-start replay
.broadcast_capacity(8192); // deeper buffer for very slow joiners
let engine = Engine::builder().application(live).build();
assert_eq!(engine.list_apps()[0].as_str(), "live");Fields§
§name: AppNameApplication name (e.g. "live").
broadcast_capacity: usizePer-stream broadcast channel capacity (frames buffered for slow joiners).
gop_capacity: usizeKeyframe-anchored GOP replay buffer size, in frames (0 disables it). Enables sub-second playback start for late joiners.
gop_byte_capacity: usizeHard cap on GOP replay-buffer payload bytes (0 = unbounded). Frame count alone does not bound memory; this caps a high-bitrate stream.
subscriber_max_lag: Option<u64>Default cumulative-lag budget for resilient subscribers (None = none): a
consumer that drops more than this many frames is evicted automatically.
Implementations§
Source§impl AppSpec
impl AppSpec
Sourcepub fn new(name: impl Into<AppName>) -> Self
pub fn new(name: impl Into<AppName>) -> Self
A new app with default capacities and GOP caching disabled.
Sourcepub fn broadcast_capacity(self, n: usize) -> Self
pub fn broadcast_capacity(self, n: usize) -> Self
Override the per-stream broadcast channel capacity.
Sourcepub fn gop_cache(self, frames: usize) -> Self
pub fn gop_cache(self, frames: usize) -> Self
Enable the keyframe-anchored GOP replay buffer, bounded to frames
(e.g. fps × gop_seconds). Late joiners receive the cached configs plus
the current GOP and start decoding immediately.
Sourcepub fn gop_cache_bytes(self, bytes: usize) -> Self
pub fn gop_cache_bytes(self, bytes: usize) -> Self
Additionally bound the GOP replay buffer to bytes of payload (0 =
unbounded). The buffer truncates a GOP that exceeds either the frame
count or this byte budget, so a high-bitrate stream cannot grow the
replay buffer without limit. Pairs with gop_cache.
Sourcepub fn subscriber_max_lag(self, frames: u64) -> Self
pub fn subscriber_max_lag(self, frames: u64) -> Self
Evict any resilient subscriber that falls more than frames behind
(cumulative dropped frames), applied by default to every
subscribe_resilient on this
app’s streams. A backstop so a chronically slow consumer is shed instead
of churning the ring forever; a caller may still set a tighter bound per
subscription.