tower_worker/lib.rs
1#![doc(html_root_url = "https://docs.rs/tower-worker/0.1.0")]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3
4//! Provides Tower layers focues on wrapping services with asynchronous worker
5//! tasks that may also make requests to the wrapped service.
6
7#[cfg(feature = "periodic")]
8#[cfg_attr(docsrs, doc(cfg(feature = "periodic")))]
9mod periodic;
10
11mod worker;
12
13/// Layer that spawns a worker task that periodically sends a request to the
14/// service at a given interval and then passes through the wrapped service..
15#[cfg(feature = "periodic")]
16#[cfg_attr(docsrs, doc(cfg(feature = "periodic")))]
17pub use periodic::PeriodicLayer;
18
19/// Layer that spawns a provided worker task using a closure that accepts a
20/// clone of the service and then passes through the wrapped service.
21pub use worker::WorkerLayer;