pub struct Follower<T: Followed = Export<Consumer<()>>> { /* private fields */ }Expand description
Carries an Export, or a Release of a passthrough track, across its
broadcast’s returns, following the publisher identities serving its path through
Following.
The same stream (the same identity) returning within the follow
continues the export. Another identity taking the path fails with
Error::Replaced, unless stitching, which
switches the program to it at once. Subscriptions are sticky, so without stitching a
replaced publisher that stays up keeps the export until it ends.
A track failure is followed only when its cause says the publisher left: the source failed
to deliver, as [moq_net::Error::retry] answers (a lost route, an ended session, a cancel,
or a going away), or a moq-transport peer ended it with a code it does not register, since
PUBLISH_DONE has none for a lost route. Any other failure is the export’s own and fails
here at once.
An identity that comes back is awaited until its catalog serves a first snapshot, with no
deadline but its own end. A return that refuses its catalog waits for the next change, and
the follow running out reports that refusal. A refusal to resolve the path at all fails at
once, as it does for every Following reader.
Implementations§
Source§impl<T: Followed> Follower<T>
impl<T: Followed> Follower<T>
Sourcepub fn new(export: T) -> Result<Self>
pub fn new(export: T) -> Result<Self>
Follow the path export reads, from the broadcast it resolved.
Fails when the export’s origin can never cover its path.
Sourcepub fn with_follow(self, follow: Duration) -> Self
pub fn with_follow(self, follow: Duration) -> Self
Wait up to follow after the broadcast ends for the same identity, or with
stitching a replacement, to come back. Defaults to
Duration::ZERO, which carries on only into an identity already serving the path.
Sourcepub fn with_stitch(self, stitch: bool) -> Self
pub fn with_stitch(self, stitch: bool) -> Self
Follow another publisher identity taking the path, as a full program switch (see
Export::follow). Defaults to false.