Skip to main content

mytheclipse_queue/
lib.rs

1//! # mytheclipse-queue
2//!
3//! A unified job queue abstraction so your background work isn't locked to one
4//! transport. Provides a single `Queue` trait, `Job` type, and `WorkerPool`
5//! executor with configurable retry/backoff, concurrency, and a dead-letter
6//! queue — behind pluggable backends:
7//!
8//! - **In-memory** (default) — `tokio::sync::mpsc` + task spawning, no external service.
9//! - **Redis** (`redis`) — LIST-based queue with atomic moves.
10//! - **NATS JetStream** (`nats`) — durable consumer with ACK/NACK.
11//! - **PostgreSQL** (`postgres`) — `SKIP LOCKED` polling.
12
13pub mod error;
14#[cfg(feature = "in-memory")]
15pub mod in_memory;
16pub mod job;
17pub mod traits;
18#[cfg(feature = "in-memory")]
19pub mod worker;
20
21#[cfg(feature = "in-memory")]
22pub mod backpressure_enqueue;
23#[cfg(feature = "in-memory")]
24pub mod batch;
25#[cfg(feature = "in-memory")]
26pub mod rate_limited;
27#[cfg(feature = "in-memory")]
28pub mod worker_rate_limited;
29#[cfg(feature = "in-memory")]
30pub use backpressure_enqueue::{
31    enqueue_with_backpressure, BackpressureEnforcer, BackpressureError,
32};
33#[cfg(feature = "in-memory")]
34pub use rate_limited::{RateLimitQueueError, RateLimitedQueue};
35#[cfg(feature = "in-memory")]
36pub use worker_rate_limited::RateLimitedWorkerPool;
37
38#[cfg(feature = "in-memory")]
39pub mod pipeline;
40#[cfg(feature = "in-memory")]
41pub use pipeline::{Stage, StageError, StageRunner};