24 lines
635 B
Rust
24 lines
635 B
Rust
use std::sync::Arc;
|
|
use application::services::{FederationEventService, NotificationEventService};
|
|
use domain::{errors::DomainError, events::DomainEvent};
|
|
|
|
pub struct NotificationHandler {
|
|
pub service: Arc<NotificationEventService>,
|
|
}
|
|
|
|
impl NotificationHandler {
|
|
pub async fn handle(&self, event: &DomainEvent) -> Result<(), DomainError> {
|
|
self.service.process(event).await
|
|
}
|
|
}
|
|
|
|
pub struct FederationHandler {
|
|
pub service: Arc<FederationEventService>,
|
|
}
|
|
|
|
impl FederationHandler {
|
|
pub async fn handle(&self, event: &DomainEvent) -> Result<(), DomainError> {
|
|
self.service.process(event).await
|
|
}
|
|
}
|