puerto_eventos/lib.rs
1//! The worker every Puerto project with domain events runs (ADR-0018 § 5): the relay that moves
2//! the outbox onto the transport, one consume loop per consumer, the health probes and graceful
3//! shutdown.
4//!
5//! It only sees the transport ports of `puerto_nucleo::eventos::transporte`: the project's
6//! `presentacion/worker/src/generado/registro.rs` hands it the adapters (`puerto_sqlx::eventos`
7//! for the `db` transport) and its consumers.
8//!
9//! ```ignore
10//! pub async fn construir_worker(config: ConfigWorker) -> Result<Bucles, String> {
11//! Ok(Bucles::new(&config)
12//! .relay(OutboxPostgres::new(pool.clone()), entregas)
13//! .consumidor(
14//! SuscripcionPostgres::new(pool.clone(), "avisar_producto_nuevo"),
15//! AvisarProductoNuevo,
16//! descartados,
17//! ))
18//! }
19//! ```
20
21pub mod conductor;
22pub mod config;
23pub mod consumidor;
24pub mod relay;
25pub mod worker;
26
27#[cfg(test)]
28mod pruebas;
29
30pub use conductor::Progreso;
31pub use config::ConfigWorker;
32pub use consumidor::Consumidor;
33pub use puerto_web::{Error, ErrorConfig};
34pub use relay::Relay;
35pub use worker::{Bucles, Worker};