tor-rtcompat: make CompoundRuntime handle SleepProviders properly
Previously, CompoundRuntime would use the default implementations of SleepProvider::now() and ::wallclock(), instead of using its wrapped SleepProvider. This mildly embarrassing omission has been rectified.
This commit is contained in:
parent
a9bae9adfe
commit
f0739e46aa
|
@ -8,6 +8,7 @@ use async_trait::async_trait;
|
|||
use educe::Educe;
|
||||
use futures::{future::FutureObj, task::Spawn};
|
||||
use std::io::Result as IoResult;
|
||||
use std::time::{Instant, SystemTime};
|
||||
|
||||
/// A runtime made of several parts, each of which implements one trait-group.
|
||||
///
|
||||
|
@ -89,6 +90,16 @@ where
|
|||
fn sleep(&self, duration: Duration) -> Self::SleepFuture {
|
||||
self.inner.sleep.sleep(duration)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn now(&self) -> Instant {
|
||||
self.inner.sleep.now()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn wallclock(&self) -> SystemTime {
|
||||
self.inner.sleep.wallclock()
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
|
|
Loading…
Reference in New Issue