#service #round-robin #task #remote #async #celery #integration

tourniquet-celery

Async native round-robin manager for remote services. celery integration.

3 unstable releases

0.2.0 May 10, 2023
0.1.1 Jan 5, 2022
0.1.0 Jan 4, 2022

#1680 in Asynchronous

Download history 47/week @ 2024-07-20 197/week @ 2024-07-27 143/week @ 2024-08-03 68/week @ 2024-08-10 45/week @ 2024-08-17 185/week @ 2024-08-24 289/week @ 2024-08-31 298/week @ 2024-09-07 207/week @ 2024-09-14 224/week @ 2024-09-21 494/week @ 2024-09-28 501/week @ 2024-10-05 213/week @ 2024-10-12 327/week @ 2024-10-19 119/week @ 2024-10-26 412/week @ 2024-11-02

1,140 downloads per month

MIT license

28KB
374 lines

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


lib.rs:

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");

Dependencies

~18–32MB
~478K SLoC