Compare commits
3 Commits
6cab2166a7
...
c8fe4a77d1
| Author | SHA1 | Date | |
|---|---|---|---|
| c8fe4a77d1 | |||
| ed8ca1d220 | |||
| fdd5dbc935 |
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -1352,6 +1352,7 @@ dependencies = [
|
||||
"async-trait",
|
||||
"chrono",
|
||||
"email_address",
|
||||
"futures",
|
||||
"thiserror 2.0.18",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
@@ -24,6 +24,7 @@ resolver = "2"
|
||||
|
||||
[workspace.dependencies]
|
||||
tokio = { version = "1.0", features = ["full"] }
|
||||
futures = "0.3"
|
||||
dotenvy = "0.15"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
|
||||
@@ -9,5 +9,6 @@ chrono = { workspace = true }
|
||||
async-trait = { workspace = true }
|
||||
anyhow = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
futures = { workspace = true }
|
||||
|
||||
email_address = "0.2.9"
|
||||
|
||||
@@ -173,6 +173,12 @@ pub trait EventPublisher: Send + Sync {
|
||||
async fn publish(&self, event: &DomainEvent) -> Result<(), DomainError>;
|
||||
}
|
||||
|
||||
pub trait EventConsumer: Send + Sync {
|
||||
/// Returns a stream of domain events. Implementations decide whether this
|
||||
/// is push-based (NATS) or poll-based (DB queue) — callers don't care.
|
||||
fn consume(&self) -> futures::stream::BoxStream<'_, Result<DomainEvent, DomainError>>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait PasswordHasher: Send + Sync {
|
||||
async fn hash(&self, plain_password: &str) -> Result<PasswordHash, DomainError>;
|
||||
|
||||
Reference in New Issue
Block a user