Trait taos_query::tmq::AsAsyncConsumer
source · pub trait AsAsyncConsumer: Sized + Send + Sync {
type Offset: IsOffset;
type Meta: IsAsyncMeta;
type Data: IsAsyncData;
// Required methods
fn default_timeout(&self) -> Timeout;
fn subscribe<'life0, 'async_trait, T, I>(
&'life0 mut self,
topics: I
) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>
where T: 'async_trait + Into<String>,
I: 'async_trait + IntoIterator<Item = T> + Send,
Self: 'async_trait,
'life0: 'async_trait;
fn recv_timeout<'life0, 'async_trait>(
&'life0 self,
timeout: Timeout
) -> Pin<Box<dyn Future<Output = RawResult<Option<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn commit<'life0, 'async_trait>(
&'life0 self,
offset: Self::Offset
) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn assignments<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Option<Vec<(String, Vec<Assignment>)>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn topic_assignment<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str
) -> Pin<Box<dyn Future<Output = Vec<Assignment>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn offset_seek<'life0, 'life1, 'async_trait>(
&'life0 mut self,
topic: &'life1 str,
vgroup_id: VGroupId,
offset: i64
) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn stream_with_timeout(
&self,
timeout: Timeout
) -> Pin<Box<dyn Send + Stream<Item = RawResult<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>> + '_>> { ... }
fn stream(
&self
) -> Pin<Box<dyn Send + Stream<Item = RawResult<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>> + '_>> { ... }
fn unsubscribe<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait { ... }
}Required Associated Types§
Required Methods§
fn default_timeout(&self) -> Timeout
fn subscribe<'life0, 'async_trait, T, I>( &'life0 mut self, topics: I ) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>where T: 'async_trait + Into<String>, I: 'async_trait + IntoIterator<Item = T> + Send, Self: 'async_trait, 'life0: 'async_trait,
sourcefn recv_timeout<'life0, 'async_trait>(
&'life0 self,
timeout: Timeout
) -> Pin<Box<dyn Future<Output = RawResult<Option<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv_timeout<'life0, 'async_trait>( &'life0 self, timeout: Timeout ) -> Pin<Box<dyn Future<Output = RawResult<Option<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
None means wait until next message come.