pub struct TranscodeRunnerHandle { /* private fields */ }Expand description
Cheaply-cloneable handle returned by
TranscodeRunner::install.
Holds the spawned per-transcoder drain tasks alive for the
server lifetime; tests and admin consumers read per-
(transcoder, rendition, broadcast, track) counters off this
handle. Mid-stride aborts (drop / Self::remove_rendition) do NOT
call Transcoder::on_stop, matching the
[lvqr_agent::AgentRunnerHandle] shutdown shape.
The ladder is mutable at runtime via Self::add_rendition /
Self::remove_rendition; Self::renditions reports the current set
so introspection stays consistent with edits.
Implementations§
Source§impl TranscodeRunnerHandle
impl TranscodeRunnerHandle
Sourcepub fn fragments_seen(
&self,
transcoder: &str,
rendition: &str,
broadcast: &str,
track: &str,
) -> u64
pub fn fragments_seen( &self, transcoder: &str, rendition: &str, broadcast: &str, track: &str, ) -> u64
Total fragments observed by transcoder producing
rendition from (broadcast, track). Returns 0 if no
transcoder under that key has fired yet.
Sourcepub fn panics(
&self,
transcoder: &str,
rendition: &str,
broadcast: &str,
track: &str,
) -> u64
pub fn panics( &self, transcoder: &str, rendition: &str, broadcast: &str, track: &str, ) -> u64
Caught-panic count for transcoder producing rendition
from (broadcast, track). Aggregates on_start,
on_fragment, and on_stop panics under one counter.
Sourcepub fn tracked(&self) -> Vec<(String, String, String, String)>
pub fn tracked(&self) -> Vec<(String, String, String, String)>
Snapshot of every (transcoder, rendition, broadcast, track)
quadruple the runner has spawned a drain task for.
Sourcepub fn renditions(&self) -> Vec<RenditionSpec>
pub fn renditions(&self) -> Vec<RenditionSpec>
The current ladder’s rendition specs, in registration order. Reflects
runtime Self::add_rendition / Self::remove_rendition edits, so
the admin introspection route stays consistent with the live ladder.
Sourcepub fn add_rendition(&self, factory: Arc<dyn TranscoderFactory>) -> bool
pub fn add_rendition(&self, factory: Arc<dyn TranscoderFactory>) -> bool
Add a rendition factory to the live ladder. New broadcasts pick it up
via the on_entry_created callback; already-live sources get a drain
task spawned retroactively. No-op returning false when a factory with
the same (name, rendition) is already registered (the caller should
map that to a 409). Note a single rendition legitimately carries
multiple factories of different names – e.g. a "software" video
encoder plus an "audio-passthrough" – so the guard keys on the
(factory name, rendition) pair, not the rendition name alone. Must be
called from within a tokio runtime.
Sourcepub fn remove_rendition(&self, rendition: &str) -> usize
pub fn remove_rendition(&self, rendition: &str) -> usize
Remove every factory + drain task for rendition. Returns the number
of drain tasks aborted. Aborting skips on_stop; the rendition’s
already-published output broadcasters drain to their subscribers and
close when the source ends. Returns 0 when no such rendition exists.
Trait Implementations§
Source§impl Clone for TranscodeRunnerHandle
impl Clone for TranscodeRunnerHandle
Source§fn clone(&self) -> TranscodeRunnerHandle
fn clone(&self) -> TranscodeRunnerHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more