pub struct TaskQueueBuilder { /* private fields */ }
Expand description
TaskQueue
builder.
§Examples
use tasque::TaskQueueBuilder;
let queue = TaskQueueBuilder::new().worker_count(4).finish();
queue.enqueue(|| println!("Hello"));
queue.enqueue(|| println!("World"));
Implementations§
Source§impl TaskQueueBuilder
impl TaskQueueBuilder
Sourcepub fn worker_count(&mut self, count: usize) -> &mut Self
pub fn worker_count(&mut self, count: usize) -> &mut Self
Sets the number of worker threads which the queue to be built will spawn.
Sourcepub fn metrics<F>(&mut self, f: F) -> &mut Selfwhere
F: FnOnce(&mut MetricBuilder),
pub fn metrics<F>(&mut self, f: F) -> &mut Selfwhere
F: FnOnce(&mut MetricBuilder),
Updates the settings of metrics using the given function.
Trait Implementations§
Source§impl Debug for TaskQueueBuilder
impl Debug for TaskQueueBuilder
Auto Trait Implementations§
impl Freeze for TaskQueueBuilder
impl RefUnwindSafe for TaskQueueBuilder
impl Send for TaskQueueBuilder
impl Sync for TaskQueueBuilder
impl Unpin for TaskQueueBuilder
impl UnwindSafe for TaskQueueBuilder
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