pub struct BroadcastConsumer { /* private fields */ }Expand description
Subscribe to arbitrary broadcast/tracks.
Implementations§
Source§impl BroadcastConsumer
impl BroadcastConsumer
Sourcepub fn subscribe_track(&self, track: &Track) -> Result<TrackConsumer, Error>
pub fn subscribe_track(&self, track: &Track) -> Result<TrackConsumer, Error>
Subscribe to a track on this broadcast.
Reuses an existing producer if one is already publishing the track; otherwise
queues a new dynamic request that the broadcast’s producer will service via
BroadcastDynamic::requested_track. Returns Error::NotFound if the
broadcast has no dynamic producer to handle requests.
Sourcepub async fn closed(&self) -> Error
pub async fn closed(&self) -> Error
Block until the broadcast is closed and return the cause.
Returns Error::Dropped if every producer was dropped without an
explicit abort, or the abort error supplied by BroadcastProducer::abort.
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Returns true if every BroadcastProducer has been dropped.
Sourcepub fn poll_closed(&self, waiter: &Waiter) -> Poll<()>
pub fn poll_closed(&self, waiter: &Waiter) -> Poll<()>
Register a conducer::Waiter that fires when the broadcast closes.
Returns Poll::Ready if already closed, otherwise Poll::Pending after
arming the waiter. Useful for composing close-detection into a larger poll
without spawning a task per broadcast.
Trait Implementations§
Source§impl Clone for BroadcastConsumer
impl Clone for BroadcastConsumer
Source§fn clone(&self) -> BroadcastConsumer
fn clone(&self) -> BroadcastConsumer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more