pub struct WorkerPool { /* private fields */ }Expand description
Server builder
Implementations§
Source§impl WorkerPool
impl WorkerPool
Sourcepub fn name<T: AsRef<str>>(self, name: T) -> Self
pub fn name<T: AsRef<str>>(self, name: T) -> Self
Set workers name.
Name is used for worker thread name
Sourcepub fn workers(self, num: usize) -> Self
pub fn workers(self, num: usize) -> Self
Set number of workers to start.
By default server uses number of available logical cpu as workers count.
Sourcepub fn stop_runtime(self) -> Self
pub fn stop_runtime(self) -> Self
Stop current ntex runtime when manager get dropped.
By default “stop runtime” is disabled.
Sourcepub fn stop_on_panic(self) -> Self
pub fn stop_on_panic(self) -> Self
Stops the server when one of the workers panics.
By default, “stop on panic” is disabled.
Sourcepub fn disable_signals(self) -> Self
pub fn disable_signals(self) -> Self
Disable signal handling.
By default, signal handling is enabled.
Sourcepub fn graceful_shutdown(self) -> Self
pub fn graceful_shutdown(self) -> Self
Graceful shutdown.
Gracefully shuts down on SIGTERM, SIGSEGV, or SIGQUIT. By default, graceful shutdown is disabled.
Sourcepub fn shutdown_timeout<T: Into<Millis>>(self, timeout: T) -> Self
pub fn shutdown_timeout<T: Into<Millis>>(self, timeout: T) -> Self
Timeout for graceful worker shutdown.
After receiving a stop signal, workers have this much time to finish serving requests. Workers that are still alive after the timeout are forcefully dropped.
By default, the shutdown timeout is set to 30 seconds.
Sourcepub fn enable_affinity(self) -> Self
pub fn enable_affinity(self) -> Self
Enable cpu affinity.
By default, affinity is disabled.
Trait Implementations§
Source§impl Clone for WorkerPool
impl Clone for WorkerPool
Source§fn clone(&self) -> WorkerPool
fn clone(&self) -> WorkerPool
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more