feat: v2 rewrite — hexagonal arch, ActivityPub federation, NATS, deployment-ready (#1)
This commit was merged in pull request #1.
This commit is contained in:
23
crates/worker/src/handlers.rs
Normal file
23
crates/worker/src/handlers.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use application::services::{FederationEventService, NotificationEventService};
|
||||
use domain::{errors::DomainError, events::DomainEvent};
|
||||
use std::sync::Arc;
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user