2023-03-11 16:49:23 +00:00
|
|
|
//#![warn(missing_docs)]
|
|
|
|
#![forbid(unsafe_code)]
|
2022-09-03 11:05:58 +00:00
|
|
|
#![doc = include_str!("../README.md")]
|
2022-08-18 11:39:10 +00:00
|
|
|
|
2022-10-18 06:30:17 +00:00
|
|
|
/// All possible options for retaining tasks in the db after their execution.
|
|
|
|
///
|
|
|
|
/// The default mode is [`RetentionMode::RemoveAll`]
|
2023-03-07 15:41:20 +00:00
|
|
|
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
|
2022-07-23 14:24:22 +00:00
|
|
|
pub enum RetentionMode {
|
2022-10-18 06:30:17 +00:00
|
|
|
/// Keep all tasks
|
2022-07-23 14:24:22 +00:00
|
|
|
KeepAll,
|
2023-03-07 15:41:20 +00:00
|
|
|
|
|
|
|
/// Remove all finished tasks independently of their final execution state.
|
2022-07-23 14:24:22 +00:00
|
|
|
RemoveAll,
|
2023-03-07 15:41:20 +00:00
|
|
|
|
2022-10-18 06:30:17 +00:00
|
|
|
/// Remove only successfully finished tasks
|
2023-03-07 15:41:20 +00:00
|
|
|
RemoveDone,
|
2022-07-23 14:24:22 +00:00
|
|
|
}
|
2022-10-18 06:30:17 +00:00
|
|
|
|
2022-07-27 17:05:05 +00:00
|
|
|
impl Default for RetentionMode {
|
|
|
|
fn default() -> Self {
|
2023-03-07 15:41:20 +00:00
|
|
|
Self::RemoveAll
|
2022-07-23 14:24:22 +00:00
|
|
|
}
|
|
|
|
}
|
2021-07-11 10:17:02 +00:00
|
|
|
|
2023-03-10 22:41:34 +00:00
|
|
|
pub use runnable::BackgroundTask;
|
2023-03-11 15:38:32 +00:00
|
|
|
pub use store::{PgTaskStore, TaskStore};
|
2023-03-10 22:41:34 +00:00
|
|
|
pub use task::CurrentTask;
|
2023-03-09 15:59:45 +00:00
|
|
|
pub use worker_pool::WorkerPool;
|
|
|
|
|
2023-03-04 19:46:09 +00:00
|
|
|
pub mod errors;
|
2023-03-04 18:07:17 +00:00
|
|
|
mod queries;
|
2023-03-04 19:46:09 +00:00
|
|
|
pub mod queue;
|
2023-03-04 18:07:17 +00:00
|
|
|
pub mod runnable;
|
2023-03-09 15:59:45 +00:00
|
|
|
mod schema;
|
2023-03-10 22:41:34 +00:00
|
|
|
pub mod store;
|
2023-03-04 19:46:09 +00:00
|
|
|
pub mod task;
|
2023-03-04 18:07:17 +00:00
|
|
|
pub mod worker;
|
|
|
|
pub mod worker_pool;
|