Skip to content

Commit

Permalink
Introducing v0.5! (#234)
Browse files Browse the repository at this point in the history
* Introducing v0.5!

* fix: api and other fixes

* Fix: improvements on backends

* fix: improve api

* fix: remove utils and simplify crates

* lint: fmt issues

* lint: clippy fixes

* fix: moved files

* clippy: fixes

* tests: updates on tests

* fixes: on internal api

* ci: update the test features

* test: remove some assertions

* docs: updated docs for tests

* fix: minor clippy and fixes

* bench: fixes on bench:

* bench: fixes on bench:

* bench: !

* bench: !

* fix: version for test

* fix: add vacuuming and other apis

* fix: improve benches

* fix: benches and worker

* fix: typo

* fix: prepared statement

* lint: clippy

* fix: redis test

* add: use ulid without jid

* add: improve the Readme.md

* fix: tower link

* bump: to 0.5
  • Loading branch information
geofmureithi authored Feb 25, 2024
1 parent 658d30e commit c443206
Show file tree
Hide file tree
Showing 100 changed files with 5,864 additions and 5,019 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: check
args: --features async-std-comp,chrono --no-default-features
- uses: actions-rs/cargo@v1
with:
command: check
args: --features async-std-comp,time --no-default-features

args: --features async-std-comp --no-default-features

test:
name: Test Suite
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

name: Mysql CI

jobs:
jobs:
test-mysql:
name: Test Suite with MySQL
runs-on: ubuntu-latest
Expand All @@ -31,15 +31,13 @@ jobs:
ports:
- 3306:3306
env:
DATABASE_URL: mysql://test:test@localhost/test
DATABASE_URL: mysql://test:test@localhost/test
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: cargo test --no-default-features --features mysql,migrate,tokio-comp,chrono -- --test-threads=1
- run: cargo test --no-default-features --features mysql,migrate,tokio-comp -- --test-threads=1
working-directory: packages/apalis-sql
- run: cargo test --no-default-features --features mysql,migrate,tokio-comp,time -- --test-threads=1
working-directory: packages/apalis-sql
4 changes: 1 addition & 3 deletions .github/workflows/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,5 @@ jobs:
profile: minimal
toolchain: stable
override: true
- run: cargo test --no-default-features --features postgres,migrate,tokio-comp,chrono -- --test-threads=1
working-directory: packages/apalis-sql
- run: cargo test --no-default-features --features postgres,migrate,tokio-comp,time -- --test-threads=1
- run: cargo test --no-default-features --features postgres,migrate,tokio-comp -- --test-threads=1
working-directory: packages/apalis-sql
16 changes: 4 additions & 12 deletions .github/workflows/redis.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
on:
push:
paths:
- 'packages/apalis-redis/**'
- '.github/workflows/redis.yaml'
- "packages/apalis-redis/**"
- ".github/workflows/redis.yaml"
pull_request:
paths:
- 'packages/apalis-redis/**'
- '.github/workflows/redis.yaml'
- "packages/apalis-redis/**"
- ".github/workflows/redis.yaml"

name: Redis CI

Expand Down Expand Up @@ -34,11 +34,3 @@ jobs:
working-directory: packages/apalis-redis
env:
REDIS_URL: redis://127.0.0.1/
- run: cargo test --features tokio-comp,time --no-default-features -- --test-threads=1
working-directory: packages/apalis-redis
env:
REDIS_URL: redis://127.0.0.1/
- run: cargo test --features async-std-comp,time --no-default-features -- --test-threads=1
working-directory: packages/apalis-redis
env:
REDIS_URL: redis://127.0.0.1/
4 changes: 1 addition & 3 deletions .github/workflows/sqlite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,5 @@ jobs:
profile: minimal
toolchain: stable
override: true
- run: cargo test --no-default-features --features sqlite,migrate,tokio-comp,chrono -- --test-threads=1
working-directory: packages/apalis-sql
- run: cargo test --no-default-features --features sqlite,migrate,tokio-comp,time -- --test-threads=1
- run: cargo test --no-default-features --features sqlite,migrate,tokio-comp -- --test-threads=1
working-directory: packages/apalis-sql
111 changes: 63 additions & 48 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apalis"
version = "0.4.9"
version = "0.5.0"
authors = ["Geoffrey Mureithi <[email protected]>"]
description = "Simple, extensible multithreaded background job processing for Rust"
repository = "https://github.com/geofmureithi/apalis"
Expand All @@ -15,9 +15,7 @@ edition = "2021"
bench = false

[features]
default = ["tracing", "tokio-comp", "chrono"]
## Support Tracing 👀
tracing = ["apalis-core/trace"]
default = ["tracing", "tokio-comp"]

## Include redis storage
redis = ["apalis-redis"]
Expand All @@ -30,67 +28,67 @@ mysql = ["apalis-sql/mysql"]
## Include Cron functionality
cron = ["apalis-cron"]

## Use chrono library for time representation
chrono = ["apalis-core/chrono", "apalis-sql?/chrono", "apalis-redis?/chrono"]
## Use time library for time representation
time = ["apalis-core/time", "apalis-sql?/time", "apalis-redis?/time"]
## Support Tracing 👀
tracing = ["dep:tracing", "dep:tracing-futures"]

## Support for Sentry exception and performance monitoring
sentry = ["apalis-core/sentry"]
sentry = ["sentry-core", "ulid?/uuid", "uuid"]
## Support Prometheus metrics
prometheus = ["apalis-core/prometheus"]
prometheus = ["metrics", "metrics-exporter-prometheus"]
## Support direct retrying jobs
retry = ["apalis-core/retry"]
retry = ["tower/retry"]
## Support timeouts on jobs
timeout = ["apalis-core/timeout"]
timeout = ["tower/timeout"]
## 💪 Limit the amount of jobs
limit = ["apalis-core/limit"]
limit = ["tower/limit"]
## Support filtering jobs based on a predicate
filter = ["apalis-core/filter"]
## Add a global extensions to jobs
extensions = ["apalis-core/extensions"]
filter = ["tower/filter"]
## Compatibility with async-std and smol runtimes
async-std-comp = [
"apalis-core/async-std-comp",
"apalis-sql?/async-std-comp",
"apalis-redis?/async-std-comp",
"apalis-cron?/async-std-comp",
"async-std",
]
## Compatibility with tokio and actix runtimes
tokio-comp = [
"apalis-core/tokio-comp",
"apalis-sql?/tokio-comp",
"apalis-redis?/tokio-comp",
"apalis-cron?/tokio-comp",
"tokio",
]

## Expose job sources for web and cli purposes
expose = ["apalis-core/expose", "apalis-sql?/expose", "apalis-redis?/expose"]

docsrs = ["document-features"]

layers = [
"sentry",
"prometheus",
"tracing",
"retry",
"timeout",
"limit",
"filter",
]

[dependencies.apalis-redis]
version = "0.4.9"
version = "0.5.0"
optional = true
path = "./packages/apalis-redis"
default-features = false

[dependencies.apalis-sql]
version = "0.4.9"

version = "0.5.0"
features = ["migrate"]
optional = true
default-features = false
path = "./packages/apalis-sql"

[dependencies.apalis-core]
version = "0.4.9"
version = "0.5.0"
default-features = false
path = "./packages/apalis-core"
features = ["storage"]

[dependencies.apalis-cron]
version = "0.4.9"
version = "0.5.0"
optional = true
default-features = false
path = "./packages/apalis-cron"
Expand All @@ -103,22 +101,7 @@ optional = true
[package.metadata.docs.rs]
# defines the configuration attribute `docsrs`
rustdoc-args = ["--cfg", "docsrs"]
features = [
"redis",
"sqlite",
"postgres",
"cron",
"sentry",
"prometheus",
"retry",
"timeout",
"limit",
"filter",
"extensions",
"tokio-comp",
"expose",
"docsrs",
]
all-features = true


[dev-dependencies]
Expand All @@ -127,11 +110,19 @@ pprof = { version = "0.13", features = ["flamegraph"] }
paste = "1.0.14"
serde = "1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
apalis-redis = { version = "0.4.9", path = "./packages/apalis-redis" }
apalis-sql = { version = "0.4.9", path = "./packages/apalis-sql", features = [
"sqlite", "postgres", "mysql"
apalis = { path = ".", features = ["redis", "sqlite", "postgres", "mysql"] }
redis = { version = "0.24", default-features = false, features = [
"script",
"aio",
"connection-manager",
] }

[dev-dependencies.sqlx]
version = "0.7.3"
default-features = false
features = ["chrono", "mysql", "sqlite", "postgres"]


[[bench]]
name = "storages"
harness = false
Expand All @@ -153,7 +144,31 @@ members = [
"examples/axum",
"examples/prometheus",
"examples/tracing",
"examples/rest-api",
# "examples/rest-api",
"examples/async-std-runtime",
"examples/basics",
]


[dependencies]
tokio = { version = "1", features = [
"rt",
], default-features = false, optional = true }
async-std = { version = "1", optional = true }
tower = { version = "0.4", features = ["util"], default-features = false }
tracing-futures = { version = "0.2.5", optional = true, default-features = false }
sentry-core = { version = "0.32.1", optional = true, default-features = false }
metrics = { version = "0.22", optional = true, default-features = false }
metrics-exporter-prometheus = { version = "0.13", optional = true, default-features = false }
thiserror = "1"
futures = "0.3"
pin-project-lite = "0.2.13"
# Needed only for sentry reporting
uuid = { version = "1.6", optional = true }
ulid = { version = "1", optional = true }
serde = { version = "1.0", features = ["derive"] }

[dependencies.tracing]
default_features = false
version = "0.1"
optional = true
Loading

0 comments on commit c443206

Please sign in to comment.