pub struct Dynamic { /* private fields */ }Expand description
Handles on-demand track creation for a broadcast.
When a consumer requests a track that doesn’t exist, the dynamic producer
picks up the request via Self::requested_track and either
track::Request::accepts it with a concrete track::Info or
track::Request::rejects it. Dropped when no longer needed; pending requests
are automatically aborted.
Implementations§
Source§impl Dynamic
impl Dynamic
Sourcepub fn poll_requested_track(
&mut self,
waiter: &Waiter,
) -> Poll<Result<Request, Error>>
pub fn poll_requested_track( &mut self, waiter: &Waiter, ) -> Poll<Result<Request, Error>>
Poll for the next consumer-requested track, without blocking.
Returns Error::Closed once the broadcast has ended, so a serving loop
knows to stop and release its handle.
Sourcepub async fn requested_track(&mut self) -> Result<Request, Error>
pub async fn requested_track(&mut self) -> Result<Request, Error>
Block until a consumer requests a track, returning a track::Request to serve.
Sourcepub fn consume(&self) -> Consumer
pub fn consume(&self) -> Consumer
Create a consumer that can subscribe to tracks in this broadcast.
Sourcepub async fn closed(&self) -> Error
pub async fn closed(&self) -> Error
Block until the broadcast ends, by Producer::close or every producer dropping.
Returns Error::Dropped, or the error passed to the deprecated abort.
Sourcepub fn poll_closed(&self, waiter: &Waiter) -> Poll<Error>
pub fn poll_closed(&self, waiter: &Waiter) -> Poll<Error>
Poll-based variant of Self::closed.