ironflow_worker/lib.rs
1//! # ironflow-worker
2//!
3//! HTTP-based background worker for ironflow. Polls the API server for
4//! pending workflow runs, executes them locally, and reports results back.
5//!
6//! The worker communicates with the API via `/api/v1/internal/*` routes,
7//! authenticated with a static `WORKER_TOKEN`.
8//!
9//! # Quick start
10//!
11//! ```no_run
12//! use std::sync::Arc;
13//! use std::time::Duration;
14//! use ironflow_worker::WorkerBuilder;
15//! use ironflow_core::providers::claude::ClaudeCodeProvider;
16//!
17//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
18//! let worker = WorkerBuilder::new("http://localhost:3000", "my-worker-token")
19//! .provider(Arc::new(ClaudeCodeProvider::new()))
20//! .concurrency(4)
21//! .poll_interval(Duration::from_secs(2))
22//! .build()?;
23//!
24//! worker.run().await?;
25//! # Ok(())
26//! # }
27//! ```
28
29mod api_store;
30pub mod error;
31pub mod worker;
32
33pub use error::WorkerError;
34pub use worker::{Worker, WorkerBuilder};