fusillade/
lib.rs

1//! Batching system for HTTP requests with retry logic and concurrency control.
2//!
3//! This crate provides 'managers' that accept submitted HTTP requests, and provides an API for
4//! checking their status over time. Behind the scenes, a daemon processes these requests in
5//! batches, retrying failed requests with exponential backoff and enforcing concurrency limits
6//!
7//! Batching system with PostgreSQL storage and background daemon for processing requests.
8
9pub mod batch;
10pub mod daemon;
11pub mod error;
12pub mod http;
13pub mod manager;
14pub mod request;
15
16// Re-export commonly used types
17pub use batch::*;
18pub use daemon::{Daemon, DaemonConfig, PriorityEndpointConfig, SlaThreshold};
19pub use error::{FusilladeError, Result};
20pub use http::{HttpClient, HttpResponse, MockHttpClient, ReqwestHttpClient};
21pub use manager::postgres::PostgresRequestManager;
22pub use manager::{DaemonExecutor, Storage};
23pub use request::*;
24
25/// Get the fusillade database migrator
26///
27/// Returns a migrator that can be run against a connection pool.
28#[cfg(feature = "postgres")]
29pub fn migrator() -> sqlx::migrate::Migrator {
30    sqlx::migrate!("./migrations")
31}