Struct ntex::server::ServiceConfig
source · pub struct ServiceConfig(_);Implementations§
source§impl ServiceConfig
impl ServiceConfig
sourcepub fn bind<U, N: AsRef<str>>(&self, name: N, addr: U) -> Result<&Self>where
U: ToSocketAddrs,
pub fn bind<U, N: AsRef<str>>(&self, name: N, addr: U) -> Result<&Self>where U: ToSocketAddrs,
Add new service to the server.
sourcepub fn listen<N: AsRef<str>>(&self, name: N, lst: TcpListener) -> &Self
pub fn listen<N: AsRef<str>>(&self, name: N, lst: TcpListener) -> &Self
Add new service to the server.
sourcepub fn on_worker_start<F, R, E>(&self, f: F) -> Result<()>where
F: Fn(ServiceRuntime) -> R + Send + Clone + 'static,
R: Future<Output = Result<(), E>> + 'static,
E: Display + 'static,
pub fn on_worker_start<F, R, E>(&self, f: F) -> Result<()>where F: Fn(ServiceRuntime) -> R + Send + Clone + 'static, R: Future<Output = Result<(), E>> + 'static, E: Display + 'static,
Register async service configuration function.
This function get called during worker runtime configuration stage. It get executed in the worker thread.