use obzenflow_core::event::JournalEvent;
use obzenflow_core::{JournalRecord, StageId};
use std::fmt::Debug;
#[derive(Debug)]
#[allow(clippy::large_enum_variant)]
pub enum PollResult<T: JournalEvent> {
Event(JournalRecord<T::Payload>),
CursorAdvanced {
upstream: StageId,
completed_data_rows: u64,
},
NoEvents,
Error(Box<dyn std::error::Error + Send + Sync>),
}
#[async_trait::async_trait]
pub trait SubscriptionPoller: Send + Sync {
type Event: JournalEvent;
async fn poll_next(&mut self) -> PollResult<Self::Event>;
fn name(&self) -> &str;
}