Deadqueue
Deadqueue is a dead simple async queue with back pressure support.
This crate provides three implementations:
-
Unlimited (
deadqueue::unlimited::Queue
)- Based on
crossbeam_queue::SegQueue
- Has unlimitied capacity and no back pressure on push
- Enabled via the
unlimited
feature in yourCargo.toml
- Based on
-
Resizable (
deadqueue::resizable::Queue
)- Based on
deadqueue::unlimited::Queue
- Has limited capacity with back pressure on push
- Supports resizing
- Enabled via the
resizable
feature in yourCargo.toml
- Based on
-
Limited (
deadqueue::limited::Queue
)- Based on
crossbeam_queue::ArrayQueue
- Has limit capacity with back pressure on push
- Does not support resizing
- Enabled via the
limited
feature in yourCargo.toml
- Based on
Features
Feature | Description | Extra dependencies | Default |
---|---|---|---|
unlimited |
Enable unlimited queue implementation | – | yes |
resizable |
Enable resizable queue implementation | deadqueue/unlimited |
yes |
limited |
Enable limited queue implementation | – | yes |
Example
use Arc;
const TASK_COUNT: usize = 1000;
const WORKER_COUNT: usize = 10;
type TaskQueue = Queue;
async
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.