pub struct Driver { /* private fields */ }Expand description
Drives origin lifecycle work and cache expiration with caller-supplied time.
Returned by Producer::new. Poll on external activity or at the deadline
it returns, supplying nondecreasing instants. Route changes, track serving, linger,
failover, and teardown run here; exact lookups and eligible announcements
update synchronously in Producer::create_broadcast.
It holds no Producer clone, so it never keeps the origin alive. Dropping
it aborts active fronts, rejects pending requests, ends announcements, and
makes subsequent producer mutations fail with Error::Closed.
moq_tokio::origin::spawn handles construction and driving for Tokio callers.
Implementations§
Source§impl Driver
impl Driver
Sourcepub fn poll(
&mut self,
now: Instant,
waiter: &Waiter,
) -> Result<Option<Instant>, Error>
pub fn poll( &mut self, now: Instant, waiter: &Waiter, ) -> Result<Option<Instant>, Error>
Process ready origin work using caller-supplied monotonic time.
See crate::time::Driver for the contract. Finishes with
Error::Closed once every producer handle has dropped and the
remaining lifecycle work has drained.