pub struct Linger<T> { /* private fields */ }Expand description
Keeps cleanly ended broadcasts announced, serving their finished tracks, for a fixed duration, then closes them.
Subscribers already reading a track get its tail when the broadcast closes; this serves
the ones that arrive after the end, such as a relay or player that read the final catalog
late. Finish the catalog and media tracks first, then hand over the broadcasts and
owner, whatever holds their routes and track producers: a broadcast stays announced only
while its Route lives, and a finished track stops being served
once its producers drop, so the owner drops only after the broadcasts close.
The deadline is fixed at new, however late poll_wait is
first polled. Dropping the handle closes the broadcasts at once, which is how an interrupt
ends it. A newer publisher announced at the same path does not end it: that one wins the
path while it is up, and readers that come back here find the finished catalog.
Implementations§
Source§impl<T> Linger<T>
impl<T> Linger<T>
Sourcepub fn new(
broadcasts: impl IntoIterator<Item = Producer>,
owner: T,
duration: Duration,
) -> Self
pub fn new( broadcasts: impl IntoIterator<Item = Producer>, owner: T, duration: Duration, ) -> Self
Keep broadcasts up for duration from now, holding owner until they close.
A zero duration is due on the first poll.