[−][src]Struct rdkafka::consumer::stream_consumer::StreamConsumer
A Kafka Consumer providing a futures::Stream
interface.
This consumer doesn't need to be polled since it has a separate polling thread. Due to the
asynchronous nature of the stream, some messages might be consumed by the consumer without being
processed on the other end of the stream. If auto commit is used, it might cause message loss
after consumer restart. Manual offset storing should be used, see the store_offset
function on
Consumer
.
Methods
impl<C: ConsumerContext> StreamConsumer<C>
[src]
pub fn start(&self) -> MessageStream<C>
[src]
Starts the StreamConsumer with default configuration (100ms polling interval and no
NoMessageReceived
notifications).
pub fn start_with(
&self,
poll_interval: Duration,
no_message_error: bool
) -> MessageStream<C>
[src]
&self,
poll_interval: Duration,
no_message_error: bool
) -> MessageStream<C>
Starts the StreamConsumer with the specified poll interval. Additionally, if
no_message_error
is set to true, it will return an error of type
KafkaError::NoMessageReceived
every time the poll interval is reached and no message has
been received.
pub fn stop(&self)
[src]
Stops the StreamConsumer, blocking the caller until the internal consumer has been stopped.
Trait Implementations
impl<C: ConsumerContext> Consumer<C> for StreamConsumer<C>
[src]
fn get_base_consumer(&self) -> &BaseConsumer<C>
[src]
fn subscribe(&self, topics: &[&str]) -> KafkaResult<()>
[src]
fn unsubscribe(&self)
[src]
fn assign(&self, assignment: &TopicPartitionList) -> KafkaResult<()>
[src]
fn seek<T: Into<Timeout>>(
&self,
topic: &str,
partition: i32,
offset: Offset,
timeout: T
) -> KafkaResult<()>
[src]
&self,
topic: &str,
partition: i32,
offset: Offset,
timeout: T
) -> KafkaResult<()>
fn commit(
&self,
topic_partition_list: &TopicPartitionList,
mode: CommitMode
) -> KafkaResult<()>
[src]
&self,
topic_partition_list: &TopicPartitionList,
mode: CommitMode
) -> KafkaResult<()>
fn commit_consumer_state(&self, mode: CommitMode) -> KafkaResult<()>
[src]
fn commit_message(
&self,
message: &BorrowedMessage,
mode: CommitMode
) -> KafkaResult<()>
[src]
&self,
message: &BorrowedMessage,
mode: CommitMode
) -> KafkaResult<()>
fn store_offset(&self, message: &BorrowedMessage) -> KafkaResult<()>
[src]
fn store_offsets(&self, tpl: &TopicPartitionList) -> KafkaResult<()>
[src]
fn subscription(&self) -> KafkaResult<TopicPartitionList>
[src]
fn assignment(&self) -> KafkaResult<TopicPartitionList>
[src]
fn committed<T>(&self, timeout: T) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
Self: Sized,
[src]
T: Into<Timeout>,
Self: Sized,
fn committed_offsets<T>(
&self,
tpl: TopicPartitionList,
timeout: T
) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
[src]
&self,
tpl: TopicPartitionList,
timeout: T
) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
fn offsets_for_timestamp<T>(
&self,
timestamp: i64,
timeout: T
) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
Self: Sized,
[src]
&self,
timestamp: i64,
timeout: T
) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
Self: Sized,
fn offsets_for_times<T>(
&self,
timestamps: TopicPartitionList,
timeout: T
) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
Self: Sized,
[src]
&self,
timestamps: TopicPartitionList,
timeout: T
) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
Self: Sized,
fn position(&self) -> KafkaResult<TopicPartitionList>
[src]
fn fetch_metadata<T>(
&self,
topic: Option<&str>,
timeout: T
) -> KafkaResult<Metadata> where
T: Into<Timeout>,
Self: Sized,
[src]
&self,
topic: Option<&str>,
timeout: T
) -> KafkaResult<Metadata> where
T: Into<Timeout>,
Self: Sized,
fn fetch_watermarks<T>(
&self,
topic: &str,
partition: i32,
timeout: T
) -> KafkaResult<(i64, i64)> where
T: Into<Timeout>,
Self: Sized,
[src]
&self,
topic: &str,
partition: i32,
timeout: T
) -> KafkaResult<(i64, i64)> where
T: Into<Timeout>,
Self: Sized,
fn fetch_group_list<T>(
&self,
group: Option<&str>,
timeout: T
) -> KafkaResult<GroupList> where
T: Into<Timeout>,
Self: Sized,
[src]
&self,
group: Option<&str>,
timeout: T
) -> KafkaResult<GroupList> where
T: Into<Timeout>,
Self: Sized,
fn pause(&self, partitions: &TopicPartitionList) -> KafkaResult<()>
[src]
fn resume(&self, partitions: &TopicPartitionList) -> KafkaResult<()>
[src]
impl<C: ConsumerContext> Drop for StreamConsumer<C>
[src]
impl FromClientConfig for StreamConsumer
[src]
fn from_config(config: &ClientConfig) -> KafkaResult<StreamConsumer>
[src]
impl<C: ConsumerContext> FromClientConfigAndContext<C> for StreamConsumer<C>
[src]
Creates a new StreamConsumer
starting from a ClientConfig
.
fn from_config_and_context(
config: &ClientConfig,
context: C
) -> KafkaResult<StreamConsumer<C>>
[src]
config: &ClientConfig,
context: C
) -> KafkaResult<StreamConsumer<C>>
Auto Trait Implementations
impl<C> RefUnwindSafe for StreamConsumer<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
impl<C> Send for StreamConsumer<C>
impl<C> Sync for StreamConsumer<C>
impl<C> Unpin for StreamConsumer<C>
impl<C> UnwindSafe for StreamConsumer<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,