mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-14 11:45:02 +01:00
things
This commit is contained in:
parent
89820b06ca
commit
606438f301
14 changed files with 173 additions and 114 deletions
25
amqp_core/src/queue.rs
Normal file
25
amqp_core/src/queue.rs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
use crate::message::Message;
|
||||
use parking_lot::Mutex;
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
use std::sync::Arc;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub type Queue = Arc<RawQueue>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RawQueue {
|
||||
pub id: Uuid,
|
||||
pub name: String,
|
||||
pub messages: Mutex<Vec<Message>>, // use a concurrent linked list???
|
||||
pub durable: bool,
|
||||
/// Whether the queue will automatically be deleted when no consumers uses it anymore.
|
||||
/// The queue can always be manually deleted.
|
||||
/// If auto-delete is enabled, it keeps track of the consumer count.
|
||||
pub deletion: QueueDeletion,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum QueueDeletion {
|
||||
Auto(AtomicUsize),
|
||||
Manual,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue