diff --git a/crates/domain/src/ports.rs b/crates/domain/src/ports.rs index 04e2040..0f03b81 100644 --- a/crates/domain/src/ports.rs +++ b/crates/domain/src/ports.rs @@ -173,6 +173,13 @@ pub trait EventPublisher: Send + Sync { async fn publish(&self, event: &DomainEvent) -> Result<(), DomainError>; } +#[async_trait] +pub trait EventConsumer: Send + Sync { + /// Returns the next available event, or `None` if the stream has ended. + /// Implementations decide whether this blocks (push) or polls (DB queue). + async fn next_event(&self) -> Result, DomainError>; +} + #[async_trait] pub trait PasswordHasher: Send + Sync { async fn hash(&self, plain_password: &str) -> Result;