tower_fallback/lib.rs
1//! A service combinator that sends requests to a first service, then retries
2//! processing on a second fallback service if the first service errors.
3//!
4//! Fallback designs have [a number of downsides][aws-fallback] but may be useful
5//! in some cases. For instance, when using batch verification, the `Fallback`
6//! wrapper can be used to fall back to individual verification of each item when
7//! a batch fails to verify.
8//!
9//! TODO: compare with similar code in linkerd.
10//!
11//! [aws-fallback]: https://aws.amazon.com/builders-library/avoiding-fallback-in-distributed-systems/
12
13pub mod future;
14mod service;
15
16pub use self::service::Fallback;
17
18/// A boxed type-erased `std::error::Error` that can be sent between threads.
19pub type BoxedError = Box<dyn std::error::Error + Send + Sync + 'static>;