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 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 Freeze for ConsumerGroup
impl RefUnwindSafe for ConsumerGroup
impl Send for ConsumerGroup
impl Sync for ConsumerGroup
impl Unpin for ConsumerGroup
impl UnsafeUnpin for ConsumerGroup
impl UnwindSafe for ConsumerGroup
Blanket Implementations§
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