Struct fang::blocking::worker_pool::WorkerPool
source · pub struct WorkerPool<BQueue>where
BQueue: Queueable + Clone + Sync + Send + 'static,{
pub queue: BQueue,
pub sleep_params: SleepParams,
pub retention_mode: RetentionMode,
pub number_of_workers: u32,
pub task_type: String,
}
Fields§
§queue: BQueue
the AsyncWorkerPool uses a queue to control the tasks that will be executed.
sleep_params: SleepParams
sleep_params controls how much time a worker will sleep while waiting for tasks execute.
retention_mode: RetentionMode
retention_mode controls if tasks should be persisted after execution
number_of_workers: u32
the number of workers of the AsyncWorkerPool.
task_type: String
The type of tasks that will be executed by AsyncWorkerPool
.
Implementations§
source§impl<BQueue> WorkerPool<BQueue>where
BQueue: Queueable + Clone + Sync + Send + 'static,
impl<BQueue> WorkerPool<BQueue>where BQueue: Queueable + Clone + Sync + Send + 'static,
sourcepub fn builder() -> WorkerPoolBuilder<BQueue, ((), (), (), (), ())>
pub fn builder() -> WorkerPoolBuilder<BQueue, ((), (), (), (), ())>
Create a builder for building WorkerPool
.
On the builder, call .queue(...)
, .sleep_params(...)
(optional), .retention_mode(...)
(optional), .number_of_workers(...)
, .task_type(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of WorkerPool
.
Trait Implementations§
Auto Trait Implementations§
impl<BQueue> RefUnwindSafe for WorkerPool<BQueue>where BQueue: RefUnwindSafe,
impl<BQueue> Send for WorkerPool<BQueue>
impl<BQueue> Sync for WorkerPool<BQueue>
impl<BQueue> Unpin for WorkerPool<BQueue>where BQueue: Unpin,
impl<BQueue> UnwindSafe for WorkerPool<BQueue>where BQueue: UnwindSafe,
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
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> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
fn into_sql<T>(self) -> Self::Expressionwhere Self: AsExpression<T> + Sized, T: SqlType + TypedExpressionType,
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,
Convert
&self
to an expression for Diesel’s query builder. Read more