1
0
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:
Nikolay Kim
2018-12-09 20:30:04 -08:00
parent 98a151db4f
commit cdd6904aa0
7 changed files with 83 additions and 42 deletions

View File

@ -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);
}