Skip to main content

runledger_runtime/
lib.rs

1//! Async runtime loops for executing Runledger jobs against a persistence
2//! backend.
3//!
4//! Use this crate to wire the operational pieces around `runledger-core`
5//! handlers and `runledger-postgres` storage:
6//! - [`registry::JobRegistry`] stores the concrete handlers a worker may claim
7//! - [`worker::run_worker_loop`] claims jobs, executes handlers, and records
8//!   progress/results
9//! - [`scheduler::run_scheduler_loop`] materializes due cron schedules into
10//!   runnable jobs
11//! - [`reaper::run_reaper_loop`] recovers jobs whose worker lease expired
12//! - [`config::JobsConfig`] centralizes poll, lease, and concurrency settings
13//!
14//! A typical service builds a shared PostgreSQL pool, registers handlers in a
15//! [`registry::JobRegistry`], and starts the worker, scheduler, and reaper
16//! loops with coordinated shutdown signals.
17
18pub mod config;
19pub mod error;
20pub mod reaper;
21pub mod registry;
22pub mod scheduler;
23pub mod worker;
24
25pub use error::{Error, ReaperError, Result, RuntimeError, SchedulerError, WorkerError};
26
27#[cfg(test)]
28#[path = "../test_support.rs"]
29pub(crate) mod test_support;