feat(webhooks): add foundation layer — migration, domain events, EventBus
This commit is contained in:
@@ -57,6 +57,7 @@ uuid = { version = "1.19.0", features = ["v4", "serde"] }
|
||||
# Logging
|
||||
tracing = "0.1"
|
||||
|
||||
reqwest = { version = "0.12", features = ["json"] }
|
||||
async-trait = "0.1"
|
||||
dotenvy = "0.15.7"
|
||||
time = "0.3"
|
||||
|
||||
12
k-tv-backend/api/src/events.rs
Normal file
12
k-tv-backend/api/src/events.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
//! Event bus type alias.
|
||||
//!
|
||||
//! The broadcast sender is kept in `AppState` and cloned into each route handler.
|
||||
//! Receivers are created with `event_tx.subscribe()`.
|
||||
|
||||
use tokio::sync::broadcast;
|
||||
use domain::DomainEvent;
|
||||
|
||||
/// A sender half of the domain-event broadcast channel.
|
||||
///
|
||||
/// Clone to share across tasks. Use `event_tx.subscribe()` to create receivers.
|
||||
pub type EventBus = broadcast::Sender<DomainEvent>;
|
||||
Reference in New Issue
Block a user