🦀 Rust implementation of Celery for producing and consuming background tasks
CronSchedule
struct to support Celery's crontab schedules.⚠️ BREAKING CHANGE ⚠️
To improve the app!
and beat!
macros and accomodate custom Broker
s and SchedulerBackend
s,
we've had to make breaking changes to the way these macros are invoked.
The biggest change is that the macros now return a future of Result<Celery>
or Result<Beat>
.
This means you must now call .await?
on the return value of the macro.
The other change is that you must now supply the actual Broker
type.
Previously, you could write something like broker = AMQP { "amqp://my-broker-url" }
,
but now you have to write it like broker = celery::broker::AMQPBroker { "amqp://my-broker-url" }
.
For a concrete example of these changes, the old way looked like this:
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let app = celery::app!(
broker = AMQP { "amqp://my-broker-url" },
tasks = [add],
task_routes = ["*" => "celery"],
);
// ...
Ok(())
}
Whereas now that will look like this:
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let app = celery::app!(
broker = celery::broker::AMQPBroker { "amqp://my-broker-url" },
tasks = [add],
task_routes = ["*" => "celery"],
).await?;
// ...
Ok(())
}
Celery apps no longer need to have static lifetimes. To remove this constraint, we changed
Celery::consume
to take &Arc<Self>
instead of a static reference to self
.
Now using tokio-amqp
internally with lapin
.
Drop explicit dependency on amq-protocol
6f284d1 Changes to app creation API (#195) 82bcb2c Add support for cron schedules (#200) bcdd4d2 Fix a bug which caused a delayed task to be dropped without being executed (#201) 3a757d7 Update env_logger requirement from 0.7 to 0.8 (#197) 1ff318c update README and examples (#193) 3a53179 Bump mypy from 0.782 to 0.790 (#192) e85cfcb ensure cache refreshed every week to avoid stale bloat (#191) da9eaaa use intradoc links (#190) 4aebecd use new way of setting env vars in GH Actions (#189) 9cb2cf4 Fix typo in README.md (#188) c5daebd drop direct dependency on amq-protocol and cookie-factory (#186) b332728 clean up beat macro c1ad799 clean up macro (#185) a9260c9 smooth out release process ff8400f use tokio-amqp (#180) b1aa408 clean up README a29957c update with transparent versions 04e62f8 update icons in docs 3abf72a add favicons 933127d new logo (#179) 065ff85 log task ID when beat scheduler sends task 4422bb3 Update lapin requirement from =1.2.3 to =1.2.4 (#178)
MockBroker
for internal testing.app
module.prelude
module.extra_content_types
feature flag.TaskResultExt
. Now takes a FnOnce() -> Context
instead of &str
.Signature
inherits default TaskOptions
from the corresponding Task
and Celery
or Beat
app..unwrap()
in the library.Task::options()
now have the current values, where app-level values are overriden by task-level values.963efb7 Mock broker, add tests, small fixes (#176) 7cd4253 move growing protocol tests to own file 41f9baf clean up unwrap() usage f51ff9b Update options.rs 261e317 Task send options (#173) 6136b7a Add support for yaml, pickle, and msgpack (#159) f5201fa Create Dependabot config file (#170) 907cae7 improve error handling and add prelude (#169) 4288fd0 update CHANGELOG
v0.4.0-rc2
.display_pretty()
method on the Celery
struct that prints out a cool ASCII logo
with some useful information about the app.AsyncResult
struct that acts as a handler for task results.Task::retry_with_countdown
and Task::retry_with_eta
trait methods so that tasks can
manually trigger a retry.Signature
struct made private to avoid confusion around which fields of TaskOptions
apply to a Signature
.Celery::send_task
now returns an AsyncResult
instead of a String
for the Ok
variant.DummyBackend
to LocalSchedulerBackend
.thiserror
for the error module instead of the deprecated failure
crate.hard_time_limit
was ignored by worker if only specified at the app or task level.1c0677b fix bug with hard time limit 9287222 small improvements related to task options (#168) 5019dec switch to thiserror (#167) 613fa46 reorganize beat module (#166) 7e0faeb add methods for manually triggering task retry (#163) 32fefd3 Update lapin requirement from =1.2.2 to =1.2.3 (#164) 04f4b16 add AsyncResult struct (#162) 805e38c add demo gif (#161) 26c8c2e pretty print info (#160)
v0.4.0-rc1
reconnect
method on the Broker
.Celery
and Beat
apps will automatically try to reconnect the broker when the connection fails.c5cbbb7 fix connection timeout handling f1d0be3 update README 1374ffb clean up b9e41f6 automatically try to reconnect with broker from worker and beat (#157) 78c3eeb pin black, reformat 7c27982 Merge branch 'master' of github.com:rusty-celery/rusty-celery 504d505 Update lapin requirement from =1.2.1 to =1.2.2 (#158) 72c6305 automatically try to reconnect
hard_time_limit
task option for compatability with Python.timeout
task option was renamed to time_limit
to be more consistent with the Python API.e919e23 move windows build into matrix build (#156) 4f50262 Adjust signal handling for windows specific compilation (#151) 2c86b9f Add hard time limit task option (#155) c2d9b7a rename timeout -> time_limit (#154) 42175df increase delay time before publishing main crate
beat
module with basic support for scheduling tasks.beat
macro to create a Beat
app.fb8d777 Implement beat (#127) e67308c Update lapin requirement from =1.2.0 to =1.2.1 (#148) 3bb4c24 Update lapin requirement from =1.1.3 to =1.2.0 (#147) abeea3d Bump mypy from 0.781 to 0.782 (#144) 995e0ed Update lapin requirement from =1.1.2 to =1.1.3 (#145) 468b9ea Bump mypy from 0.780 to 0.781 (#143) 0c0fd28 Update lapin requirement from =1.1.0 to =1.1.2 (#142) 3de1a47 improve release process 4e21f56 Update lapin requirement from =1.0.2 to =1.1.0 (#140) a336199 Update lapin requirement from =1.0.1 to =1.0.2 (#137) ffb8bad Bump mypy from 0.770 to 0.780 (#138) 2795b54 Update lapin requirement from =1.0.0 to =1.0.1 (#136)
lapin
dependency updated to 1.0.BrokerError
variants trimmed and simplified.Broker::consume
now takes a BrokerError
as an argument.2dc022c update lapin and amq deps (#135) e657480 add check to ensure CHANGELOG updated (#132) f2cfb28 add shebang to python example b3e0fe7 improve CI cache keys (#131)
Message::headers::origin
field fixed. Before it included quotes around the hostname.Request::hostname
field now populated by the Celery
app consuming the task.with_timeout
will only set the soft_time_limit
so that the behavior
is the same for Python consumers.3ba5c8f improve examples and CI caching (#129) cce951e fixes origin field, populate hostname field (#128) eeaa70f update CI (#126) 99b73c0 resolve #66 (#96) 5c34edc make Signature Clone-able 703f1ef improve readme (#125)