#[cfg(feature = "kafka")]
pub mod kafka;
#[cfg(feature = "redis")]
pub mod redis;
pub trait EventBusConfig: Send + Sync + Clone + 'static {
type Backend: BackendMarker;
fn topics(&self) -> &[String];
fn config_id(&self) -> String;
fn as_any(&self) -> &dyn std::any::Any;
}
pub trait BackendMarker: Send + Sync + 'static {}
#[cfg(feature = "kafka")]
#[derive(Debug, Clone, Copy)]
pub struct Kafka;
#[cfg(feature = "kafka")]
impl BackendMarker for Kafka {}
#[derive(Debug, Clone, Copy)]
pub struct InMemory;
impl BackendMarker for InMemory {}
#[cfg(feature = "redis")]
#[derive(Debug, Clone, Copy)]
pub struct Redis;
#[cfg(feature = "redis")]
impl BackendMarker for Redis {}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum TopologyMode {
Provision,
Validate,
}
#[derive(Debug, Clone)]
pub struct ProcessingLimits {
pub max_events_per_frame: Option<usize>,
pub max_drain_millis: Option<u64>,
}
impl Default for ProcessingLimits {
fn default() -> Self {
Self {
max_events_per_frame: Some(100),
max_drain_millis: Some(10),
}
}
}