#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

#1256 in Asynchronous

Download history 74/week @ 2023-12-30 67/week @ 2024-01-13 48/week @ 2024-01-20 64/week @ 2024-01-27 76/week @ 2024-02-03 112/week @ 2024-02-10 65/week @ 2024-02-17 192/week @ 2024-02-24 106/week @ 2024-03-02 33/week @ 2024-03-09 94/week @ 2024-03-16 87/week @ 2024-03-23 98/week @ 2024-03-30 70/week @ 2024-04-06 96/week @ 2024-04-13

388 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
~516K SLoC