mod application;
mod events;
mod handle;
pub use application::Application;
pub use events::{StreamEvent, StreamEventKind};
pub(crate) use handle::{mono_ms, now_ms};
pub use handle::{Qos, StreamHandle, StreamMetadata, StreamState, Subscription};
use crate::{AppName, Result, StreamId, StreamKey};
use async_trait::async_trait;
use tokio::sync::broadcast;
#[async_trait]
pub trait PublishRegistry: Send + Sync + 'static {
async fn start_publish(&self, key: &StreamKey) -> Result<StreamHandle>;
async fn end_publish(&self, key: &StreamKey) -> Result<()>;
}
pub trait PlaybackRegistry: Send + Sync + 'static {
fn get_stream(&self, key: &StreamKey) -> Result<StreamHandle>;
fn list_streams(&self, app: &AppName) -> Result<Vec<StreamId>>;
}
pub trait EventBus: Send + Sync + 'static {
fn subscribe_events(&self, app: &AppName) -> Result<broadcast::Receiver<StreamEvent>>;
}