blob: d64729fa535e92f64f275cd9b4204b5b92297446 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
use crate::Executor;
use futures::Future;
/// An old `tokio` runtime.
#[cfg_attr(docsrs, doc(cfg(feature = "tokio_old")))]
pub type TokioOld = tokio_old::runtime::Runtime;
impl Executor for TokioOld {
fn new() -> Result<Self, futures::io::Error> {
tokio_old::runtime::Runtime::new()
}
fn spawn(&self, future: impl Future<Output = ()> + Send + 'static) {
let _ = tokio_old::runtime::Runtime::spawn(self, future);
}
fn enter<R>(&self, f: impl FnOnce() -> R) -> R {
tokio_old::runtime::Runtime::enter(self, f)
}
}
|