azums 0.1.2

High-performance job queue & streaming engine for Rust — from embedded to cloud
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use azums::{quickstart, Job};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let flow = quickstart("postgres://localhost/flow").await?;
    flow.enqueue(Job::new("greet", serde_json::json!({"name": "World"})))
        .await?;
    flow.register_handler("greet", |job| async move {
        println!("Hello, {}!", job.payload["name"]);
        Ok(())
    })
    .await;
    flow.run().await?;
    Ok(())
}