mirror of
https://git.asonix.dog/asonix/background-jobs.git
synced 2024-11-21 19:40:59 +00:00
Expose all subcrates
This commit is contained in:
parent
cff4da40b8
commit
56291a91f8
2 changed files with 38 additions and 7 deletions
18
Cargo.toml
18
Cargo.toml
|
@ -23,10 +23,16 @@ members = [
|
|||
"examples/metrics-example",
|
||||
"examples/panic-example",
|
||||
"examples/postgres-example",
|
||||
"examples/tokio-example",
|
||||
]
|
||||
|
||||
[features]
|
||||
default = ["background-jobs-actix", "background-jobs-metrics"]
|
||||
default = ["actix-rt", "metrics"]
|
||||
actix-rt = ["dep:background-jobs-actix"]
|
||||
metrics = ["dep:background-jobs-metrics"]
|
||||
postgres = ["dep:background-jobs-postgres"]
|
||||
sled = ["dep:background-jobs-sled"]
|
||||
tokio = ["dep:background-jobs-tokio"]
|
||||
completion-logging = [
|
||||
"background-jobs-core/completion-logging",
|
||||
"error-logging",
|
||||
|
@ -51,3 +57,13 @@ optional = true
|
|||
version = "0.17.0"
|
||||
path = "jobs-postgres"
|
||||
optional = true
|
||||
|
||||
[dependencies.background-jobs-sled]
|
||||
version = "0.17.0"
|
||||
path = "jobs-sled"
|
||||
optional = true
|
||||
|
||||
[dependencies.background-jobs-tokio]
|
||||
version = "0.17.0"
|
||||
path = "jobs-tokio"
|
||||
optional = true
|
||||
|
|
27
src/lib.rs
27
src/lib.rs
|
@ -112,7 +112,7 @@
|
|||
//! ```
|
||||
//!
|
||||
//! #### Running jobs
|
||||
//! By default, this crate ships with the `background-jobs-actix` feature enabled. This uses the
|
||||
//! By default, this crate ships with the `actix-rt` feature enabled. This uses the
|
||||
//! `background-jobs-actix` crate to spin up a Server and Workers, and provides a mechanism for
|
||||
//! spawning new jobs.
|
||||
//!
|
||||
|
@ -163,7 +163,7 @@
|
|||
|
||||
pub use background_jobs_core::{Backoff, Job, MaxRetries, UnsendJob, UnsendSpawner};
|
||||
|
||||
#[cfg(feature = "background-jobs-metrics")]
|
||||
#[cfg(feature = "metrics")]
|
||||
pub mod metrics {
|
||||
pub use background_jobs_metrics::{
|
||||
build, install, JobStat, MetricsStorage, SetRecorderError, Stats, StatsHandle,
|
||||
|
@ -182,14 +182,29 @@ pub mod dev {
|
|||
pub mod memory_storage {
|
||||
pub use background_jobs_core::memory_storage::{Storage, Timer};
|
||||
|
||||
#[cfg(feature = "background-jobs-actix")]
|
||||
#[cfg(feature = "actix-rt")]
|
||||
pub use background_jobs_actix::ActixTimer;
|
||||
|
||||
#[cfg(feature = "tokio")]
|
||||
pub use background_jobs_tokio::TokioTimer;
|
||||
}
|
||||
|
||||
#[cfg(feature = "background-jobs-actix")]
|
||||
pub use background_jobs_actix::{ActixSpawner, Manager, QueueHandle, WorkerConfig};
|
||||
#[cfg(feature = "actix-rt")]
|
||||
pub mod actix {
|
||||
pub use background_jobs_actix::{ActixSpawner as Spawner, Manager, QueueHandle, WorkerConfig};
|
||||
}
|
||||
|
||||
#[cfg(feature = "background-jobs-postgres")]
|
||||
#[cfg(feature = "postgres")]
|
||||
pub mod postgres {
|
||||
pub use background_jobs_postgres::Storage;
|
||||
}
|
||||
|
||||
#[cfg(feature = "sled")]
|
||||
pub mod sled {
|
||||
pub use background_jobs_sled::{Error, Storage};
|
||||
}
|
||||
#[cfg(feature = "tokio")]
|
||||
|
||||
pub mod tokio {
|
||||
pub use background_jobs_tokio::{QueueHandle, WorkerConfig};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue