#![deny(rust_2018_idioms, unreachable_pub, missing_debug_implementations)]
#![allow(clippy::let_underscore_future)]
use ntex_service::ServiceFactory;
mod manager;
pub mod net;
mod pool;
mod server;
mod signals;
mod wrk;
pub use self::pool::WorkerPool;
pub use self::server::Server;
pub use self::signals::{signal, Signal};
pub use self::wrk::{Worker, WorkerStatus, WorkerStop};
#[derive(Default, Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WorkerId(usize);
impl WorkerId {
pub(self) fn next(&mut self) -> WorkerId {
let id = WorkerId(self.0);
self.0 += 1;
id
}
}
#[allow(async_fn_in_trait)]
pub trait ServerConfiguration: Send + Clone + 'static {
type Item: Send + 'static;
type Factory: ServiceFactory<Self::Item> + 'static;
async fn create(&self) -> Result<Self::Factory, ()>;
fn paused(&self) {}
fn resumed(&self) {}
fn terminate(&self) {}
async fn stop(&self) {}
}