rs_sqs_receiver/
lib.rs

1//! # AWS SQS Receiver
2//!
3//! An asynchronous AWS SQS message receiver framework that abstracts SQS polling complexity
4//! and allows users to register custom message handlers with shared resources.
5//!
6//! ## Features
7//!
8//! - Asynchronous SQS message processing with tokio
9//! - Trait-based handler system with generic shared resource support
10//! - Both functional and object-oriented API patterns
11//! - Automatic message deletion on successful processing
12//! - Continue-on-error semantics for resilient processing
13//! - Long polling with configurable parameters
14//!
15//! ## Quick Start
16//!
17//! ```rust,no_run
18//! use aws_sqs_receiver::{client::create_sqs_client_from_env, receiver::start_receive_queue};
19//!
20//! #[tokio::main]
21//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
22//!     let client = create_sqs_client_from_env().await;
23//!     let queue_url = "https://sqs.region.amazonaws.com/account/queue-name";
24//!     let shared_data = "shared state".to_string();
25//!
26//!     start_receive_queue(
27//!         client,
28//!         queue_url,
29//!         shared_data,
30//!         |message, shared| async move {
31//!             println!("Processing message: {} with shared: {}", message, shared);
32//!             Ok(())
33//!         }
34//!     ).await;
35//!
36//!     Ok(())
37//! }
38//! ```
39
40pub mod client;
41pub mod errors;
42pub mod receiver;