Refactor ActivityPub integration and add SQLite federation support
- Removed event-publisher dependency from Cargo.lock and Cargo.toml. - Introduced sqlite-federation crate with necessary dependencies and implementation. - Updated activitypub crate to use new ActivityPubPort trait for better abstraction. - Refactored event handling to utilize domain ports instead of direct dependencies. - Adjusted presentation layer to accommodate new ActivityPub service structure. - Removed unused test setup for ActivityPub service in favor of NoopActivityPubService. - Cleaned up SQLite adapter to remove unnecessary dependencies and streamline functionality.
This commit is contained in:
@@ -2,6 +2,8 @@ use async_trait::async_trait;
|
||||
use domain::{errors::DomainError, events::DomainEvent, ports::EventPublisher};
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
pub use domain::ports::EventHandler;
|
||||
|
||||
pub struct EventPublisherConfig {
|
||||
pub channel_buffer: usize,
|
||||
}
|
||||
@@ -16,11 +18,6 @@ impl EventPublisherConfig {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait EventHandler: Send + Sync {
|
||||
async fn handle(&self, event: &DomainEvent) -> Result<(), DomainError>;
|
||||
}
|
||||
|
||||
pub struct ChannelEventPublisher {
|
||||
sender: mpsc::Sender<DomainEvent>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user