pub trait StreamConsumer<T: StreamEntry, G: ConsumerGroup>:
Default
+ Send
+ Sync {
type Data: Send + Sync;
const XREAD_BLOCK_TIME: Duration = _;
const BATCH_SIZE: usize = 20usize;
const CONCURRENCY: usize = 10usize;
// Required method
fn process_event(
&self,
ctx: &Context<'_, Self::Data>,
event: &T,
status: &DeliveryStatus,
) -> impl Future<Output = Result<(), TaskError>> + Send;
// Provided methods
fn process_event_stream(
&self,
ctx: &Context<'_, Self::Data>,
ids: Vec<StreamId>,
status: &DeliveryStatus,
) -> impl Future<Output = Result<(), RedisError>> + Send { ... }
fn process_stream_entry(
&self,
ctx: &Context<'_, Self::Data>,
entry: StreamId,
status: &DeliveryStatus,
) -> impl Future<Output = Result<(), RedisError>> + Send { ... }
}Provided Associated Constants§
const XREAD_BLOCK_TIME: Duration = _
const BATCH_SIZE: usize = 20usize
const CONCURRENCY: usize = 10usize
Required Associated Types§
Required Methods§
fn process_event( &self, ctx: &Context<'_, Self::Data>, event: &T, status: &DeliveryStatus, ) -> impl Future<Output = Result<(), TaskError>> + Send
Provided Methods§
fn process_event_stream( &self, ctx: &Context<'_, Self::Data>, ids: Vec<StreamId>, status: &DeliveryStatus, ) -> impl Future<Output = Result<(), RedisError>> + Send
fn process_stream_entry( &self, ctx: &Context<'_, Self::Data>, entry: StreamId, status: &DeliveryStatus, ) -> impl Future<Output = Result<(), RedisError>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.