Crates.io | tourniquet-celery |
lib.rs | tourniquet-celery |
version | 0.2.0 |
source | src |
created_at | 2022-01-04 14:26:09.487326 |
updated_at | 2023-05-10 09:18:30.427528 |
description | Async native round-robin manager for remote services. celery integration. |
homepage | |
repository | https://github.com/Tuetuopay/tourniquet |
max_upload_size | |
id | 507803 |
size | 8,985 |
Tourniquet integration with the celery library.
#
#[celery::task]
async fn do_work(work: String) -> TaskResult<()> {
// Some work
Ok(())
}
let rr = RoundRobin::new(
vec!["amqp://rabbit01:5672/".to_owned(), "amqp://rabbit02:5672".to_owned()],
CeleryConnector { name: "rr", routes: &[("*", "my_route")], ..Default::default() },
);
rr.send_task(|| do_work::new(work.clone())).await.expect("Failed to send task");
License: MIT