1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-27 06:09:02 +02:00

remove tokio runners (#253)

This commit is contained in:
Rob Ede
2021-01-29 02:21:06 +00:00
committed by GitHub
parent feac376c17
commit ba39c8436d
10 changed files with 103 additions and 337 deletions

View File

@ -8,6 +8,8 @@
use std::future::Future;
use tokio::task::JoinHandle;
// Cannot define a main macro when compiled into test harness.
// Workaround for https://github.com/rust-lang/rust/issues/62127.
#[cfg(all(feature = "macros", not(test)))]
@ -26,13 +28,13 @@ pub use self::system::System;
/// Spawns a future on the current arbiter.
///
/// # Panics
/// This function panics if actix system is not running.
/// Panics if Actix system is not running.
#[inline]
pub fn spawn<F>(f: F)
pub fn spawn<Fut>(f: Fut) -> JoinHandle<()>
where
F: Future<Output = ()> + 'static,
Fut: Future<Output = ()> + 'static,
{
Arbiter::spawn(f)
tokio::task::spawn_local(f)
}
/// Asynchronous signal handling