pub struct ElectedClock { /* private fields */ }Expand description
The elected pipeline clock as the sinks hold it: a stable shared handle whose target can be replaced (M1004).
ClockSync is handed to each sink once, before any frame flows, and the
runner cannot reach the sinks again afterwards (their elements have moved
into the arms, on other threads under the thread-per-arm runner). So when the
elected clock degrades and the runner re-elects, the way the new choice
reaches every sink is this handle: the ClockSync they hold points at the
ElectedClock, and swap retargets it in place.
as_ticker stays None here: it lends out a
borrow of the clock, which a target that can be replaced cannot give.
shared_ticker is owned, so it forwards and
follows the swap. The runner only installs this indirection when it is going
to monitor clock health; otherwise sinks get the elected clock directly.
Implementations§
Source§impl ElectedClock
impl ElectedClock
Sourcepub fn new(target: Arc<dyn PipelineClock + Send + Sync>) -> Self
pub fn new(target: Arc<dyn PipelineClock + Send + Sync>) -> Self
A handle pointing at the freshly elected clock.
Trait Implementations§
Source§impl Debug for ElectedClock
impl Debug for ElectedClock
Source§impl PipelineClock for ElectedClock
impl PipelineClock for ElectedClock
fn now_ns(&self) -> u64
Source§fn healthy(&self) -> bool
fn healthy(&self) -> bool
PtpClock) reports false once its master is
gone. The runner polls the elected clock and, on a loss, posts
BusMessage::ClockLost and re-elects
over the candidates that are still healthy.Source§fn as_ticker(&self) -> Option<&dyn DynAsyncClock>
fn as_ticker(&self) -> Option<&dyn DynAsyncClock>
PipelinePacket::Tick, M880) from the
pipeline clock itself, so a parse_launch line running against any
sleepable clock ticks without a separate entry point. Read more