use std::future::Future;
use crate::backend::ConsumerOptionsInner;
use crate::error::Result;
use crate::handler::MessageHandler;
use crate::topic::{SequencedTopic, Topic};
#[allow(dead_code)]
pub(crate) trait ConsumerImpl: Send + Sync {
fn run<T, H>(
&self,
handler: H,
ctx: H::Context,
options: ConsumerOptionsInner,
) -> impl Future<Output = Result<()>> + Send
where
T: Topic,
H: MessageHandler<T>;
fn run_fifo<T, H>(
&self,
handler: H,
ctx: H::Context,
options: ConsumerOptionsInner,
) -> impl Future<Output = Result<()>> + Send
where
T: SequencedTopic,
H: MessageHandler<T>;
fn run_dlq<T, H>(
&self,
handler: H,
ctx: H::Context,
options: ConsumerOptionsInner,
) -> impl Future<Output = Result<()>> + Send
where
T: Topic,
H: MessageHandler<T>;
fn spawn_fifo_shards<T, H>(
&self,
handler: H,
ctx: H::Context,
options: ConsumerOptionsInner,
) -> impl Future<Output = Result<Vec<tokio::task::JoinHandle<Result<()>>>>> + Send
where
T: SequencedTopic,
H: MessageHandler<T>;
}