Struct rdkafka_wrap::consumer::base_consumer::PartitionQueue
source · pub struct PartitionQueue<C>where
C: ConsumerContext,{ /* 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>(
&self,
timeout: T
) -> Option<Result<BorrowedMessage<'_>, KafkaError>>where
T: Into<Timeout>,
pub fn poll<T>( &self, timeout: T ) -> Option<Result<BorrowedMessage<'_>, KafkaError>>where T: Into<Timeout>,
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)where
F: Fn() + Send + Sync + 'static,
pub fn set_nonempty_callback<F>(&mut self, f: F)where F: Fn() + Send + Sync + 'static,
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> !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