pub struct ConsumerGroup {
pub name: String,
/* private fields */
}Expand description
A consumer group manages message delivery and acknowledgment for a set of consumers reading from the same queue.
Fields§
§name: StringGroup name
Implementations§
Source§impl ConsumerGroup
impl ConsumerGroup
Sourcepub fn new(name: impl Into<String>) -> ConsumerGroup
pub fn new(name: impl Into<String>) -> ConsumerGroup
Create a new consumer group
Sourcepub fn add_consumer(&mut self, name: &str)
pub fn add_consumer(&mut self, name: &str)
Register a consumer (or return existing)
Sourcepub fn deliver(&mut self, seq: u64, consumer: &str)
pub fn deliver(&mut self, seq: u64, consumer: &str)
Record that a message was delivered to a consumer
Sourcepub fn pending_for_consumer(&self, consumer: &str) -> Vec<&PendingEntry>
pub fn pending_for_consumer(&self, consumer: &str) -> Vec<&PendingEntry>
Get all pending entries for a consumer
Sourcepub fn all_pending(&self) -> Vec<&PendingEntry>
pub fn all_pending(&self) -> Vec<&PendingEntry>
Get all pending entries
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Number of pending messages
Sourcepub fn consumers(&self) -> Vec<&ConsumerState>
pub fn consumers(&self) -> Vec<&ConsumerState>
List consumers
Sourcepub fn is_pending(&self, seq: u64) -> bool
pub fn is_pending(&self, seq: u64) -> bool
Check if a message is pending
Auto Trait Implementations§
impl Forget for ConsumerGroup
impl Freeze for ConsumerGroupwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const LeafNode<u64, PendingEntry> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(u64, PendingEntry)>>: Freeze,
PhantomData<(String, ConsumerState)>: Freeze,
impl Move for ConsumerGroup
impl RefUnwindSafe for ConsumerGroup
impl Send for ConsumerGroupwhere
RawVecInner: Send,
NodeRef<Owned, u64, PendingEntry, LeafOrInternal>: Send,
BoxRaw<(u64, PendingEntry)>: Send,
RawTable<(String, ConsumerState)>: Send,
impl Sync for ConsumerGroupwhere
RawVecInner: Sync,
NodeRef<Owned, u64, PendingEntry, LeafOrInternal>: Sync,
BoxRaw<(u64, PendingEntry)>: Sync,
RawTable<(String, ConsumerState)>: Sync,
impl Unpin for ConsumerGroup
impl UnsafeUnpin for ConsumerGroupwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<u64, PendingEntry> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(u64, PendingEntry)>>: UnsafeUnpin,
PhantomData<(String, ConsumerState)>: UnsafeUnpin,
impl UnwindSafe for ConsumerGroupwhere
RawVecInner: UnwindSafe,
BTreeMap<u64, PendingEntry>: UnwindSafe,
HashMap<String, ConsumerState>: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request