#round-robin #remote #service #celery #async #task #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

#965 in Asynchronous

Download history 23/week @ 2023-11-27 9/week @ 2023-12-04 34/week @ 2023-12-11 90/week @ 2023-12-18 22/week @ 2023-12-25 74/week @ 2024-01-01 67/week @ 2024-01-15 48/week @ 2024-01-22 64/week @ 2024-01-29 76/week @ 2024-02-05 113/week @ 2024-02-12 66/week @ 2024-02-19 192/week @ 2024-02-26 111/week @ 2024-03-04 13/week @ 2024-03-11

382 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–33MB
~507K SLoC