pub struct WorkerBuilder { /* private fields */ }Expand description
Builder for configuring the worker pool subsystem
Implementations§
Source§impl WorkerBuilder
impl WorkerBuilder
Sourcepub fn num_workers(self, workers: usize) -> Self
pub fn num_workers(self, workers: usize) -> Self
Set the number of worker threads
Default: 1
Sourcepub fn max_queue_size(self, size: usize) -> Self
pub fn max_queue_size(self, size: usize) -> Self
Set the maximum number of queued tasks
Default: 10000
Sourcepub fn scheduler_interval(self, interval: Duration) -> Self
pub fn scheduler_interval(self, interval: Duration) -> Self
Set how often to check for periodic tasks
Default: 10ms
Sourcepub fn task_timeout_warning(self, timeout: Duration) -> Self
pub fn task_timeout_warning(self, timeout: Duration) -> Self
Set the maximum time a task can run before warning
Default: 30 seconds
Sourcepub fn build(self) -> WorkerConfig
pub fn build(self) -> WorkerConfig
Build the worker pool configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkerBuilder
impl RefUnwindSafe for WorkerBuilder
impl Send for WorkerBuilder
impl Sync for WorkerBuilder
impl Unpin for WorkerBuilder
impl UnwindSafe for WorkerBuilder
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more