feat: v2 rewrite — hexagonal arch, ActivityPub federation, NATS, deployment-ready #1
@@ -16,6 +16,7 @@ postgres-federation = { workspace = true }
|
||||
activitypub = { workspace = true }
|
||||
activitypub-base = { workspace = true }
|
||||
nats = { workspace = true }
|
||||
event-publisher = { workspace = true }
|
||||
auth = { workspace = true }
|
||||
sqlx = { workspace = true }
|
||||
async-nats = { workspace = true }
|
||||
|
||||
@@ -5,6 +5,8 @@ use sqlx::PgPool;
|
||||
use activitypub::ThoughtsObjectHandler;
|
||||
use activitypub_base::{ApFederationConfig, FederationData};
|
||||
use domain::{errors::DomainError, events::DomainEvent, ports::EventPublisher};
|
||||
use event_publisher::EventPublisherAdapter;
|
||||
use nats::NatsTransport;
|
||||
use postgres::activitypub::PgActivityPubRepository;
|
||||
use postgres_federation::{PostgresApUserRepository, PostgresFederationRepository};
|
||||
use presentation::state::AppState;
|
||||
@@ -40,7 +42,7 @@ pub async fn build(cfg: &Config) -> Infrastructure {
|
||||
Some(url) => match async_nats::connect(url).await {
|
||||
Ok(client) => {
|
||||
tracing::info!("Connected to NATS at {url}");
|
||||
Arc::new(nats::NatsEventPublisher::new(client))
|
||||
Arc::new(EventPublisherAdapter::new(NatsTransport::new(client)))
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::warn!("NATS connect failed ({e}) — falling back to no-op publisher");
|
||||
|
||||
Reference in New Issue
Block a user