Skip to main content

Crate ironflow_runtime

Crate ironflow_runtime 

Source
Expand description

§ironflow-runtime

The daemon/server layer for ironflow, providing webhook HTTP endpoints and cron scheduling on top of ironflow_core operations.

This crate exposes a runtime::Runtime builder that lets you declaratively register webhook routes (with pluggable authentication) and cron jobs, then start an Axum HTTP server with graceful shutdown support.

§Quick start

use ironflow_runtime::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    Runtime::new()
        .webhook("/hooks/github", WebhookAuth::github("my-secret"), |payload| async move {
            println!("received: {payload}");
        })
        .cron("0 */5 * * * *", "health-check", || async {
            println!("running health check");
        })
        .serve("0.0.0.0:3000")
        .await?;

    Ok(())
}

§Modules

Modules§

error
Typed error for the ironflow runtime.
prelude
Convenience re-exports for common usage.
runtime
The runtime server builder and HTTP serving logic.
webhook
Webhook authentication strategies for incoming HTTP requests.