puerto 0.15.0

Puerto — Rust full-stack DDD framework CLI. Scaffolds Clean Architecture projects with auto-wired DI, SQLx support, and zero manual wiring. Formerly puerto-framework.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
mod consumers;
mod generated;

/// The second process of this project (ADR-0018 of Puerto): it relays the outbox the API writes
/// and runs the consumers. The loops, health probes and graceful shutdown come from the Puerto
/// runtime, `puerto-events`; the wiring is in `generated/registry.rs`, the consumers in
/// `consumers/`.
#[tokio::main]
async fn main() -> Result<(), puerto_events::Error> {
    let config = puerto_events::WorkerConfig::from_env()?;
    puerto_events::Worker::new(config)
        .run(generated::registry::build_worker)
        .await
}