Expand description
§RustQueue — Background jobs without infrastructure
Add persistent, crash-safe background job processing to any Rust application. No Redis. No RabbitMQ. No external services.
use rustqueue::RustQueue;
use serde_json::json;
let rq = RustQueue::redb("./jobs.db")?.build()?;
let id = rq.push("emails", "send-welcome", json!({"to": "a@b.com"}), None).await?;
let jobs = rq.pull("emails", 1).await?;
rq.ack(jobs[0].id, None).await?;Jobs persist to an embedded ACID database. They survive crashes and restarts.
When you outgrow embedded mode, run the same engine as a standalone server
with rustqueue serve.
Re-exports§
pub use builder::RustQueue;pub use engine::error::RustQueueError;pub use engine::models::BackoffStrategy;pub use engine::models::Job;pub use engine::models::JobId;pub use engine::models::JobState;pub use engine::models::QueueCounts;pub use engine::models::QueueOrdering;pub use engine::models::Schedule;pub use engine::plugins::JobProcessor;pub use engine::plugins::WorkerFactory;pub use engine::plugins::WorkerRegistry;pub use engine::queue::FailResult;pub use engine::queue::JobOptions;pub use engine::queue::QueueInfo;pub use engine::queue::QueueManager;pub use engine::workflow::CollectArrayJoin;pub use engine::workflow::Workflow;pub use engine::workflow::WorkflowJoin;pub use engine::workflow::WorkflowStep;pub use metrics_registry::MetricsRegistry;pub use storage::StorageBackend;
Modules§
- api
- HTTP REST API module for RustQueue.
- auth
- Shared bearer-token authentication utilities.
- axum_
integration - Axum integration for RustQueue.
- builder
- High-level builder for creating a
RustQueueinstance as an embedded library. - config
- Configuration module for RustQueue.
- dashboard
- Embedded web dashboard module.
- engine
- metrics_
registry - Metrics recorder installation helpers.
- protocol
- TCP protocol module — newline-delimited JSON interface to RustQueue.
- storage