Struct tasque::TaskQueueBuilder
[−]
[src]
pub struct TaskQueueBuilder { /* fields omitted */ }
TaskQueue
builder.
Examples
use tasque::TaskQueueBuilder; let queue = TaskQueueBuilder::new().worker_count(4).finish(); queue.enqueue(|| println!("Hello")); queue.enqueue(|| println!("World"));
Methods
impl TaskQueueBuilder
[src]
fn new() -> Self
[src]
Makes a new TaskQueueBuilder
instance.
fn queue_name(&mut self, name: &str)
[src]
Sets the name of this queue.
If it is specified, the metrics of this queue have the label name="${name}"
.
fn worker_count(&mut self, count: usize) -> &mut Self
[src]
Sets the number of worker threads which the queue to be built will spawn.
fn metrics_registry(&mut self, registry: Registry)
[src]
Sets the registry of the metrics of this queue.
The default value is prometrics::default_registry()
.
fn finish(&self) -> TaskQueue
[src]
Builds a TaskQueue
instance.