mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-16 12:45:04 +01:00
queue declare
This commit is contained in:
parent
606438f301
commit
8532d454c3
13 changed files with 255 additions and 71 deletions
|
|
@ -25,6 +25,8 @@ impl Default for GlobalData {
|
|||
inner: Arc::new(Mutex::new(GlobalDataInner {
|
||||
connections: HashMap::new(),
|
||||
channels: HashMap::new(),
|
||||
queues: HashMap::new(),
|
||||
default_exchange: HashMap::new(),
|
||||
})),
|
||||
}
|
||||
}
|
||||
|
|
@ -40,6 +42,9 @@ impl GlobalData {
|
|||
pub struct GlobalDataInner {
|
||||
pub connections: HashMap<Uuid, ConnectionHandle>,
|
||||
pub channels: HashMap<Uuid, ChannelHandle>,
|
||||
pub queues: HashMap<Uuid, Queue>,
|
||||
/// Todo: This is just for testing and will be removed later!
|
||||
pub default_exchange: HashMap<String, Queue>,
|
||||
}
|
||||
|
||||
pub type ConnectionHandle = Handle<Connection>;
|
||||
|
|
@ -104,3 +109,14 @@ impl Channel {
|
|||
global_data.channels.remove(&self.id);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn gen_uuid() -> Uuid {
|
||||
Uuid::from_bytes(rand::random())
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! amqp_todo {
|
||||
() => {
|
||||
return Err(::amqp_core::error::ConException::NotImplemented.into())
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ pub struct RawQueue {
|
|||
pub name: String,
|
||||
pub messages: Mutex<Vec<Message>>, // use a concurrent linked list???
|
||||
pub durable: bool,
|
||||
pub exclusive: Option<Uuid>,
|
||||
/// 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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue