pub struct Dynamic { /* private fields */ }Expand description
A served route, from Producer::dynamic: advertises a path prefix and
answers the Consumer::request_broadcast calls beneath it.
The origin-level analogue of broadcast::Dynamic: where that serves tracks
on demand within a broadcast, this serves whole broadcasts on demand within
an origin. A relay holds one per route a peer announces to it, materializing
a requested path from that peer; an application holds one to answer a
subtree it never publishes ahead of time.
Drop it to retract the route and reject the requests still waiting to be
served; update re-prices it in place.
Implementations§
Source§impl Dynamic
impl Dynamic
Sourcepub fn update(&self, route: Route) -> Result<(), Error>
pub fn update(&self, route: Route) -> Result<(), Error>
Re-price the route in place: replace its hops and cost.
Consumers observe another active update for the same prefix; sessions
forward it as a restart, so route churn never looks like new content. The
prefix is fixed at announce time: to move a route, drop this and call
Producer::dynamic again. Fails with Error::Closed once the origin’s
Driver has been dropped.
Sourcepub fn poll_requested_broadcast(
&self,
waiter: &Waiter,
) -> Poll<Result<Request, Error>>
pub fn poll_requested_broadcast( &self, waiter: &Waiter, ) -> Poll<Result<Request, Error>>
Poll for the next requested path under this route, without blocking.
Returns Error::Closed once the origin’s Driver has been dropped:
no request will ever arrive again, so handler loops should end.