Struct rdkafka::consumer::base_consumer::PartitionQueue
source · pub struct PartitionQueue<C>where
C: ConsumerContext + 'static,{ /* private fields */ }
Expand description
A message queue for a single partition.
Implementations§
source§impl<C> PartitionQueue<C>where
C: ConsumerContext,
impl<C> PartitionQueue<C>where
C: ConsumerContext,
sourcepub fn poll<T: Into<Timeout>>(
&self,
timeout: T,
) -> Option<KafkaResult<BorrowedMessage<'_>>>
pub fn poll<T: Into<Timeout>>( &self, timeout: T, ) -> Option<KafkaResult<BorrowedMessage<'_>>>
Polls the partition for new messages.
The timeout
parameter controls how long to block if no messages are
available.
Remember that you must also call BaseConsumer::poll
on the
associated consumer regularly, even if no messages are expected, to
serve callbacks.
sourcepub fn set_nonempty_callback<F>(&mut self, f: F)
pub fn set_nonempty_callback<F>(&mut self, f: F)
Sets a callback that will be invoked whenever the queue becomes nonempty.
Trait Implementations§
source§impl<C> Drop for PartitionQueue<C>where
C: ConsumerContext,
impl<C> Drop for PartitionQueue<C>where
C: ConsumerContext,
Auto Trait Implementations§
impl<C> Freeze for PartitionQueue<C>
impl<C> !RefUnwindSafe for PartitionQueue<C>
impl<C> Send for PartitionQueue<C>
impl<C> Sync for PartitionQueue<C>
impl<C> Unpin for PartitionQueue<C>
impl<C> !UnwindSafe for PartitionQueue<C>
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