jev-client's [Runtime] on tokio's clock and timers.
10impl Runtime for TokioRuntime { 11 fn now(&self) -> Instant { 12 Instant::now() 13 } 14 15 fn wall_clock(&self) -> SystemTime { 16 SystemTime::now() 17 } 18 19 fn sleep(&self, duration: Duration) -> impl Future<Output = ()> { 20 tokio::time::sleep(duration) 21 } 22 23 fn timeout<F: Future>(&self, duration: Duration, future: F) -> impl Future<Output = Option<F::Output>> { 24 async move { tokio::time::timeout(duration, future).await.ok() } 25 }
The jitter fraction only spreads retries. Nanoseconds of the clock are random enough for that and need no dependency (as jevsnes' own retry loop drew it).