1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//! # Azums
//!
//! **The durable execution layer for Rust.**
//!
//! `azums` turns ordinary async Rust handlers into recoverable, retryable, observable at-least-once
//! execution across Memory, SQLite, PostgreSQL, and Redis. It manages persistence, scheduling,
//! leases, heartbeats, attempts, retries, dead-letter handling, replay, and durable event streams
//! without requiring a separate message broker.
//!
//! *Performance claims are benchmark-derived and reproducible through `azums-perf` and Criterion.*
//! See [Live Benchmark Dashboard](https://blockforge-dev.github.io/azums/) for current measured results and conditions.
//!
//! ---
//!
//! ## Quickstart
//!
//! Add `azums` to your `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! azums = "1.0"
//! tokio = { version = "1", features = ["full"] }
//! serde = { version = "1", features = ["derive"] }
//! ```
//!
//! Run zero-config background job processing:
//!
//! ```rust,no_run
//! use azums::{quickstart, Job};
//! use serde::Deserialize;
//!
//! #[derive(Deserialize)]
//! struct GreetPayload {
//! name: String,
//! }
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! let client = quickstart("memory").await?;
//!
//! client.enqueue(Job::new("greet", serde_json::json!({"name": "World"}))).await?;
//!
//! client.register_handler("greet", |job| async move {
//! let payload: GreetPayload = job.payload_typed()?;
//! println!("Hello, {}!", payload.name);
//! Ok(())
//! }).await;
//!
//! client.run_until_empty().await?;
//! Ok(())
//! }
//! ```
//!
//! ---
//!
//! ## Storage Backend Compatibility
//!
//! `azums` supports four storage backends under a unified [`StorageBackend`] interface:
//!
//! | Backend | Connection URL | Feature Flag | Ideal Use Case |
//! |---|---|---|---|
//! | **PostgreSQL** | `postgres://user:pass@localhost/db` | `postgres` (default) | Multi-node Kubernetes microservices & production DBs |
//! | **SQLite** | `sqlite://jobs.db?mode=rwc` | `sqlite` (default) | Single-binary web apps, desktop tools, IoT edge devices |
//! | **Redis** | `redis://127.0.0.1:6379` | `redis` (default) | Ultra-low latency memory queue & native streams |
//! | **In-Memory** | `memory` | Core | Fast unit tests, CI test pipelines, zero disk I/O |
//!
//! ---
//!
//! ## Error Handling
//!
//! All queue operations return [`Error`] (aliased as [`QueueError`]):
//!
//! - Use [`job.payload_typed::<T>()`](azums_core::Job::payload_typed) to automatically parse JSON payloads into strongly-typed structs.
//! - Unhandled failures automatically trigger retries up to `job.max_attempts` before moving to the Dead-Letter Queue (`status = "dlq"`).
//!
//! ---
//!
//! ## Deployment
//!
//! - **Single-Binary Service**: Use `azums` inside your Axum, Actix, Poem, or Rocket application binary.
//! - **Separate Worker Nodes**: Run background workers independently using the [`worker`](https://crates.io/crates/worker) crate or `azumsctl`.
//! - **Monitoring Dashboard**: The optional web dashboard is available as a separate package (`azums-dashboard`).
/// Storage backend adapters and backend-specific constructors.
/// Environment-driven runtime configuration.
/// PostgreSQL pool and migration helpers.
/// Job repositories, execution policies, attempts, and operational views.
/// High-level client, handler registry, and Tokio worker runtime.
/// High-level durable event stream handle.
// Convenience re-exports forming the stable public API.
pub use ;
pub use PostgresBackend;
pub use RedisBackend;
pub use ;
pub use Config;
pub use ;
pub use ;
pub use ;
pub use IngestDecisionsRepo;
pub use ;
pub use MetricsRepo;
pub use ;
pub use ;
pub use JobsRepo;
pub use RetryConfig;
pub use JobRunner;
pub use ;
pub use StreamHandle;