pub struct DispatcherBuilder { /* private fields */ }Expand description
Builder for configuring a Dispatcher.
Implementations§
Source§impl DispatcherBuilder
impl DispatcherBuilder
pub fn new() -> Self
pub fn host(self, host: impl Into<String>) -> Self
pub fn port(self, port: u16) -> Self
pub fn max_connections(self, max: u32) -> Self
pub fn heartbeat_interval(self, ms: u64) -> Self
pub fn heartbeat_timeout(self, ms: u64) -> Self
Sourcepub fn max_pool_size(self, max: u32) -> Self
pub fn max_pool_size(self, max: u32) -> Self
Set the maximum number of workers allowed in the pool. Workers connecting beyond this limit will be rejected.
Sourcepub fn min_pool_size(self, min: u32) -> Self
pub fn min_pool_size(self, min: u32) -> Self
Set the minimum pool size. When the pool drops below this threshold,
the on_pool_below_min callback is invoked.
Sourcepub fn on_pool_below_min(self, cb: impl Fn(u32) + Send + Sync + 'static) -> Self
pub fn on_pool_below_min(self, cb: impl Fn(u32) + Send + Sync + 'static) -> Self
Set a callback to be invoked when the pool size drops below min_pool_size.
The callback receives the current pool size.
pub fn build(self) -> Dispatcher
Trait Implementations§
Source§impl Debug for DispatcherBuilder
impl Debug for DispatcherBuilder
Auto Trait Implementations§
impl Freeze for DispatcherBuilder
impl !RefUnwindSafe for DispatcherBuilder
impl Send for DispatcherBuilder
impl Sync for DispatcherBuilder
impl Unpin for DispatcherBuilder
impl UnsafeUnpin for DispatcherBuilder
impl !UnwindSafe for DispatcherBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more