Struct tasque::TaskQueue [] [src]

pub struct TaskQueue { /* fields omitted */ }

Task queue.

This queue spawns worker threads for executing registered tasks.

Examples

use tasque::TaskQueue;

let queue = TaskQueue::new();
queue.enqueue(|| println!("Hello"));
queue.enqueue(|| println!("World"));

Methods

impl TaskQueue
[src]

[src]

Makes a new TaskQueue instance.

This is equivalent to TaskQueueBuilder::new().finish().

[src]

Enqueues a task.

The task will be executed by a worker thread.

If the thread panics while executing the task, it will be automatically restarted. Note that the task will not be retried in such case.

Trait Implementations

impl Debug for TaskQueue
[src]

[src]

Formats the value using the given formatter.

impl Clone for TaskQueue
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for TaskQueue
[src]

[src]

Returns the "default value" for a type. Read more