mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-27 06:09:02 +02:00
rename Server to ServerBuilder
This commit is contained in:
@ -5,8 +5,23 @@ mod builder;
|
||||
mod runtime;
|
||||
mod system;
|
||||
|
||||
pub use self::arbiter::Arbiter;
|
||||
pub use self::builder::{Builder, SystemRunner};
|
||||
pub use self::runtime::{Handle, Runtime};
|
||||
pub use self::system::System;
|
||||
// pub use tokio_current_thread::spawn;
|
||||
// pub use tokio_current_thread::TaskExecutor;
|
||||
|
||||
/// Spawns a future on the current arbiter.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// This function panics if actix system is not running.
|
||||
pub fn spawn<F>(f: F)
|
||||
where
|
||||
F: futures::Future<Item = (), Error = ()> + 'static,
|
||||
{
|
||||
if !System::is_set() {
|
||||
panic!("System is not running");
|
||||
}
|
||||
|
||||
Arbiter::spawn(f);
|
||||
}
|
||||
|
Reference in New Issue
Block a user