tourniquet-celery

Crates.iotourniquet-celery
lib.rstourniquet-celery
version0.2.0
sourcesrc
created_at2022-01-04 14:26:09.487326
updated_at2023-05-10 09:18:30.427528
descriptionAsync native round-robin manager for remote services. celery integration.
homepage
repositoryhttps://github.com/Tuetuopay/tourniquet
max_upload_size
id507803
size8,985
(Tuetuopay)

documentation

README

tourniquet-celery

Tourniquet integration with the celery library.

Example

#
#[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

Commit count: 41

cargo fmt