mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-14 19:55:03 +01:00
consume prototype
This commit is contained in:
parent
beb2187cd6
commit
93ce632b5d
21 changed files with 328 additions and 108 deletions
|
|
@ -1,6 +1,8 @@
|
|||
use crate::consumer::Consumer;
|
||||
use crate::message::Message;
|
||||
use crate::{newtype, newtype_id, ChannelId};
|
||||
use parking_lot::Mutex;
|
||||
use std::borrow::Borrow;
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
|
@ -14,6 +16,12 @@ newtype!(
|
|||
pub QueueName: Arc<str>
|
||||
);
|
||||
|
||||
impl Borrow<str> for QueueName {
|
||||
fn borrow(&self) -> &str {
|
||||
std::borrow::Borrow::borrow(&self.0)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RawQueue {
|
||||
pub id: QueueId,
|
||||
|
|
@ -25,6 +33,7 @@ pub struct RawQueue {
|
|||
/// The queue can always be manually deleted.
|
||||
/// If auto-delete is enabled, it keeps track of the consumer count.
|
||||
pub deletion: QueueDeletion,
|
||||
pub consumers: Mutex<Vec<Consumer>>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue