Skip to main content

queuerious/
lib.rs

1//! Queuerious Rust SDK — Job queue observability.
2//!
3//! Report job lifecycle events (started, completed, failed, retrying, dead-lettered)
4//! to the [Queuerious](https://queuerious.io) platform.
5//!
6//! # Quick Start
7//!
8//! ```no_run
9//! use queuerious::{QueuriousClient, JobEvent, Backend};
10//!
11//! # async fn example() -> Result<(), queuerious::QueuriousError> {
12//! let client = QueuriousClient::builder()
13//!     .api_key("qk_your_api_key")
14//!     .endpoint("https://api.queuerious.io")
15//!     .build()?;
16//!
17//! // Report a job started event (non-blocking, batched).
18//! client.report(
19//!     JobEvent::started("email-queue", Backend::RabbitMQ, "job-123", "SendEmail")
20//!         .payload(serde_json::json!({"to": "user@example.com"}))
21//!         .build()
22//! )?;
23//!
24//! // Gracefully shut down (flushes pending events).
25//! client.shutdown().await?;
26//! # Ok(())
27//! # }
28//! ```
29
30mod batcher;
31mod client;
32mod config;
33mod error;
34mod events;
35mod reporter;
36mod transport;
37mod types;
38
39#[cfg(feature = "tower")]
40pub mod middleware;
41
42#[cfg(any(feature = "agent", feature = "metrics", feature = "commands"))]
43pub mod agent;
44
45pub use client::{QueuriousClient, QueuriousClientBuilder};
46pub use error::QueuriousError;
47pub use events::{Backend, JobEvent, JobEventFailedBuilder, JobEventStartedBuilder};
48pub use reporter::{NoopReporter, QueuriousReporter};
49pub use types::{IngestEventError, IngestEventResult, IngestResponse};
50
51#[cfg(feature = "commands")]
52pub use agent::traits::{CommandExecutor, CommandResult, PendingCommand};
53#[cfg(feature = "metrics")]
54pub use agent::traits::{MetricsCollector, QueueMetricSnapshot};
55#[cfg(any(feature = "metrics", feature = "commands"))]
56pub use agent::{Agent, AgentConfig};