This commit is contained in:
Antonio Scandurra 2023-10-22 12:21:28 +02:00
parent 909fbb9538
commit f4135e6bcf
12 changed files with 860 additions and 637 deletions

View file

@ -8,6 +8,7 @@ use std::{
pin::Pin,
sync::Arc,
task::{Context, Poll},
time::Duration,
};
use util::TryFutureExt;
@ -151,6 +152,11 @@ impl Executor {
}
}
pub fn timer(&self, duration: Duration) -> smol::Timer {
// todo!("integrate with deterministic dispatcher")
smol::Timer::after(duration)
}
pub fn is_main_thread(&self) -> bool {
self.dispatcher.is_main_thread()
}