diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 970f4d5..b9c38ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ on: push: branches: [main, develop] pull_request: + workflow_call: env: CARGO_TERM_COLOR: always diff --git a/CHANGELOG.md b/CHANGELOG.md index 1aa51d9..1c4cb6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.0-rc.2] - 2026-01-10 + +- bump: to v1.0.0-rc.2 (#34) + ### Changed - feat: use DateTime abstraction from apalis-sql diff --git a/Cargo.lock b/Cargo.lock index 174bd06..82a7344 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,8 +38,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce833bf2acb6984eaa4e58ee4afacc0eaaefabc2c54ad5df46ea43255d115f7f" dependencies = [ "apalis-core", + "rmp-serde", "serde", "serde_json", + "thiserror", ] [[package]] @@ -346,9 +348,9 @@ checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" [[package]] name = "cc" -version = "1.2.51" +version = "1.2.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203" +checksum = "cd4932aefd12402b36c60956a4fe0035421f544799057659ff86f923657aada3" dependencies = [ "find-msvc-tools", "shlex", @@ -584,9 +586,9 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "find-msvc-tools" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff" +checksum = "f449e6c6c08c865631d4890cfacf252b3d396c9bcc83adb6623cdb02a8336c41" [[package]] name = "fixedbitset" @@ -1083,9 +1085,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.179" +version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a2d376baa530d1238d133232d15e239abad80d05838b4b59354e5268af431f" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" [[package]] name = "libm" @@ -1593,6 +1595,25 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rmp" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ba8be72d372b2c9b35542551678538b562e7cf86c3315773cae48dfbfe7790c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "rmp-serde" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f81bee8c8ef9b577d1681a70ebbc962c232461e397b22c208c43c04b67a155" +dependencies = [ + "rmp", + "serde", +] + [[package]] name = "rsa" version = "0.9.10" diff --git a/Cargo.toml b/Cargo.toml index 7f4bdd9..ae1a062 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,7 @@ ulid = { version = "1", features = ["serde"] } tokio = { version = "1", features = ["macros", "rt-multi-thread"] } apalis = { version = "1.0.0-rc.2" } apalis-workflow = { version = "0.1.0-rc.2" } +apalis-codec = { version = "0.1.0-rc.2", features = ["msgpack"]} futures-util = "0.3.31" chrono = "0.4" diff --git a/examples/codec.rs b/examples/codec.rs new file mode 100644 index 0000000..7aedaf7 --- /dev/null +++ b/examples/codec.rs @@ -0,0 +1,23 @@ +use apalis::prelude::*; +use apalis_codec::msgpack::MsgPackCodec; +use apalis_sqlite::SqliteStorage; +use sqlx::SqlitePool; + +#[tokio::main] +async fn main() { + let pool = SqlitePool::connect(":memory:").await.unwrap(); + SqliteStorage::setup(&pool).await.unwrap(); + let mut backend = SqliteStorage::new(&pool).with_codec::(); + backend.push(42).await.unwrap(); + + async fn task(task: u32, worker: WorkerContext) -> Result<(), BoxDynError> { + apalis_core::timer::sleep(std::time::Duration::from_secs(1)).await; + assert_eq!(task, 42); + worker.stop()?; + Ok(()) + } + let worker = WorkerBuilder::new("rango-tango") + .backend(backend) + .build(task); + worker.run().await.unwrap(); +} diff --git a/examples/dag.rs b/examples/dag.rs index e62d015..f1f88e4 100644 --- a/examples/dag.rs +++ b/examples/dag.rs @@ -1,4 +1,5 @@ use apalis::prelude::*; +use apalis_codec::msgpack::MsgPackCodec; use apalis_sqlite::SqliteStorage; use apalis_workflow::*; use sqlx::SqlitePool; @@ -28,7 +29,7 @@ async fn collector( async fn main() { let pool = SqlitePool::connect(":memory:").await.unwrap(); SqliteStorage::setup(&pool).await.unwrap(); - let mut backend = SqliteStorage::new(&pool); + let mut backend = SqliteStorage::new(&pool).with_codec::(); backend.push_start(vec![42, 43, 44]).await.unwrap(); let dag_flow = DagFlow::new("user-etl-workflow"); diff --git a/supply-chain/config.toml b/supply-chain/config.toml index 2959789..91db2b3 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -128,7 +128,7 @@ version = "1.11.0" criteria = "safe-to-deploy" [[exemptions.cc]] -version = "1.2.51" +version = "1.2.52" criteria = "safe-to-deploy" [[exemptions.cfg-if]] @@ -236,7 +236,7 @@ version = "2.3.0" criteria = "safe-to-deploy" [[exemptions.find-msvc-tools]] -version = "0.1.6" +version = "0.1.7" criteria = "safe-to-deploy" [[exemptions.fixedbitset]] @@ -444,7 +444,7 @@ version = "1.5.0" criteria = "safe-to-deploy" [[exemptions.libc]] -version = "0.2.179" +version = "0.2.180" criteria = "safe-to-deploy" [[exemptions.libm]] @@ -659,6 +659,14 @@ criteria = "safe-to-deploy" version = "0.17.14" criteria = "safe-to-deploy" +[[exemptions.rmp]] +version = "0.8.15" +criteria = "safe-to-deploy" + +[[exemptions.rmp-serde]] +version = "1.3.1" +criteria = "safe-to-deploy" + [[exemptions.rsa]] version = "0.9.10" criteria = "safe-to-deploy"