simple_shutdown/spawn.rs
1use core::future::Future;
2
3pub trait Spawn {
4 fn spawn(&self, future: impl Future<Output = ()> + Send + 'static);
5}
6
7#[cfg(feature = "tokio")]
8impl Spawn for &tokio::runtime::Runtime {
9 fn spawn(&self, future: impl Future<Output = ()> + Send + 'static) {
10 tokio::runtime::Runtime::spawn(self, future);
11 }
12}