Compare commits
3 commits
5a95a71b7c
...
a0c924a4f3
Author | SHA1 | Date | |
---|---|---|---|
asonix | a0c924a4f3 | ||
asonix | 9141f662d7 | ||
asonix | c1d7d9e750 |
|
@ -1,14 +1,17 @@
|
|||
[package]
|
||||
name = "background-jobs"
|
||||
description = "Background Jobs implemented with actix and futures"
|
||||
description = "asynchronous background jobs implemented with pluggable backends and runtimes"
|
||||
version = "0.17.0"
|
||||
license = "AGPL-3.0"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
repository = "https://git.asonix.dog/asonix/background-jobs"
|
||||
readme = "README.md"
|
||||
keywords = ["jobs", "processor", "actix"]
|
||||
keywords = ["jobs", "processor", "actix", "tokio", "postgres", "sled"]
|
||||
edition = "2021"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"jobs-actix",
|
||||
|
|
|
@ -5,7 +5,7 @@ version = "0.17.0"
|
|||
license = "AGPL-3.0"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
repository = "https://git.asonix.dog/asonix/background-jobs"
|
||||
keywords = ["jobs", "processor"]
|
||||
keywords = ["jobs", "processor", "actix"]
|
||||
readme = "../README.md"
|
||||
edition = "2021"
|
||||
|
||||
|
|
|
@ -9,6 +9,9 @@ keywords = ["jobs", "processor"]
|
|||
readme = "../README.md"
|
||||
edition = "2021"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
||||
[features]
|
||||
default = ["error-logging"]
|
||||
completion-logging = []
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
[package]
|
||||
name = "background-jobs-metrics"
|
||||
description = "Background Jobs implemented with actix and futures - metrics subscriber"
|
||||
description = "Metrics subscriber for accessing metrics produced by background jobs"
|
||||
version = "0.17.0"
|
||||
license = "AGPL-3.0"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
repository = "https://git.asonix.dog/asonix/background-jobs"
|
||||
readme = "../README.md"
|
||||
keywords = ["jobs", "processor", "actix"]
|
||||
keywords = ["jobs", "processor", "metrics"]
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
[package]
|
||||
name = "background-jobs-postgres"
|
||||
description = "Postgres storage backend for background-jobs"
|
||||
version = "0.17.0"
|
||||
license = "AGPL-3.0"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
repository = "https://git.asonix.dog/asonix/background-jobs"
|
||||
keywords = ["jobs", "processor", "postgres"]
|
||||
readme = "../README.md"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
|
|
@ -5,6 +5,7 @@ version = "0.17.0"
|
|||
license = "AGPL-3.0"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
repository = "https://git.asonix.dog/asonix/background-jobs"
|
||||
keywords = ["jobs", "processor", "sled"]
|
||||
readme = "../README.md"
|
||||
edition = "2021"
|
||||
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
[package]
|
||||
name = "background-jobs-tokio"
|
||||
description = "in-process jobs processor based on Tokio"
|
||||
version = "0.17.0"
|
||||
license = "AGPL-3.0"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
repository = "https://git.asonix.dog/asonix/background-jobs"
|
||||
keywords = ["jobs", "processor", "tokio"]
|
||||
readme = "../README.md"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
|
|
@ -259,7 +259,7 @@ where
|
|||
let processors = processors.clone();
|
||||
|
||||
if let Err(e) = spawn::spawn_in(&mut superset, "worker-supervisor", async move {
|
||||
while let Some(_) = set.join_next().await {
|
||||
while set.join_next().await.is_some() {
|
||||
metrics::counter!("background-jobs.tokio.worker.finished", "queue" => queue.clone())
|
||||
.increment(1);
|
||||
|
||||
|
|
14
src/lib.rs
14
src/lib.rs
|
@ -160,6 +160,18 @@
|
|||
//! If you want to create your own jobs processor based on this idea, you can depend on the
|
||||
//! `background-jobs-core` crate, which provides the Job trait, as well as some
|
||||
//! other useful types for implementing a jobs processor and job store.
|
||||
//!
|
||||
//! ### Available Features
|
||||
//!
|
||||
//! | feature | description |
|
||||
//! | -------------------- | --------------------------------------------------------------------------------------------------- |
|
||||
//! | `actix-rt` | Enables the actix-based job runner and the ActixTimer for the in-memory job storage implementation |
|
||||
//! | `metrics` | Enables the metrics subscriber to extract metrics from the MetricsStorage adapter |
|
||||
//! | `postgres` | Enables the postgres job storage adapter |
|
||||
//! | `sled` | Enables the sled job storage adapter |
|
||||
//! | `tokio` | Enables the tokio-based job runner and the TokioTimer for the in-memory job storage impelementation |
|
||||
//! | `completion-logging` | Enables a tracing event that occurs whenever a job completes |
|
||||
//! | `error-logging` | Enables a tracing event that occurs whenever a job fails |
|
||||
|
||||
pub use background_jobs_core::{Backoff, Job, MaxRetries, UnsendJob, UnsendSpawner};
|
||||
|
||||
|
@ -203,8 +215,8 @@ pub mod postgres {
|
|||
pub mod sled {
|
||||
pub use background_jobs_sled::{Error, Storage};
|
||||
}
|
||||
#[cfg(feature = "tokio")]
|
||||
|
||||
#[cfg(feature = "tokio")]
|
||||
pub mod tokio {
|
||||
pub use background_jobs_tokio::{QueueHandle, WorkerConfig};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue