pub struct GroupedConsumer { /* private fields */ }Expand description
Grouped consumer (worker) that receives assignments from a coordinator
Implementations§
Source§impl GroupedConsumer
impl GroupedConsumer
Sourcepub async fn join(
server_addr: &str,
coordinator_addr: SocketAddr,
config: WorkerConfig,
) -> Result<Self, ClientError>
pub async fn join( server_addr: &str, coordinator_addr: SocketAddr, config: WorkerConfig, ) -> Result<Self, ClientError>
Join a consumer group by connecting to the coordinator
Sourcepub fn assignments(&self) -> &[u32]
pub fn assignments(&self) -> &[u32]
Get current topic assignments
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Get current generation
Sourcepub async fn next_batch(
&mut self,
topic_id: u32,
) -> Result<Option<PollResult>, ClientError>
pub async fn next_batch( &mut self, topic_id: u32, ) -> Result<Option<PollResult>, ClientError>
Receive the next batch for a specific assigned topic.
Sourcepub async fn consume(
&mut self,
topic_id: u32,
) -> Result<Option<PollResult>, ClientError>
pub async fn consume( &mut self, topic_id: u32, ) -> Result<Option<PollResult>, ClientError>
Primary consume interface alias for a specific assigned topic.
Sourcepub async fn poll(
&mut self,
topic_id: u32,
) -> Result<Option<PollResult>, ClientError>
pub async fn poll( &mut self, topic_id: u32, ) -> Result<Option<PollResult>, ClientError>
Compatibility wrapper for callers still using polling terminology.
Sourcepub async fn commit(&mut self, topic_id: u32) -> Result<(), ClientError>
pub async fn commit(&mut self, topic_id: u32) -> Result<(), ClientError>
Commit offset for a specific topic
Sourcepub async fn commit_all(&mut self) -> Result<(), ClientError>
pub async fn commit_all(&mut self) -> Result<(), ClientError>
Commit all topics
Sourcepub async fn heartbeat(&mut self) -> Result<u64, ClientError>
pub async fn heartbeat(&mut self) -> Result<u64, ClientError>
Send heartbeat to coordinator
Sourcepub async fn leave(self) -> Result<(), ClientError>
pub async fn leave(self) -> Result<(), ClientError>
Leave the consumer group
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GroupedConsumer
impl !RefUnwindSafe for GroupedConsumer
impl Send for GroupedConsumer
impl Sync for GroupedConsumer
impl Unpin for GroupedConsumer
impl UnsafeUnpin for GroupedConsumer
impl !UnwindSafe for GroupedConsumer
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> 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