#rabbitmq

deadpool-amqprs

Dead simple async pool for amqprs

2 unstable releases

0.2.0 Feb 14, 2023
0.1.0 Feb 12, 2023

#39 in #rabbitmq

Download history 331/week @ 2024-07-03 64/week @ 2024-07-10 109/week @ 2024-07-17 119/week @ 2024-07-24 110/week @ 2024-07-31 180/week @ 2024-08-07 143/week @ 2024-08-14 144/week @ 2024-08-21 81/week @ 2024-08-28 268/week @ 2024-09-04 196/week @ 2024-09-11 271/week @ 2024-09-18 297/week @ 2024-09-25 167/week @ 2024-10-02 306/week @ 2024-10-09 242/week @ 2024-10-16

1,110 downloads per month

MIT license

7KB
91 lines

deadpool-amqprs

Deadpool for amqprs

Deadpool is a dead simple async pool for connections and objects of any type.

This crate implements a deadpool manager for amqprs.

Example

use deadpool_amqprs::Config;
use amqprs::{callbacks::{DefaultChannelCallback, DefaultConnectionCallback}, connection::OpenConnectionArguments};

#[tokio::main]
async fn main() {
    let config = Config::new_with_con_args(OpenConnectionArguments::default());
    let pool = config.create_pool();
    
    let con = pool.get().await.unwrap();
    con.register_callback(DefaultConnectionCallback).await.unwrap();

    let channel = con.open_channel().await.unwrap();
    channel.register_callback(DefaultChannelCallback).await.unwrap();

    // Do stuff with `channel`.
}

Dependencies

~3–13MB
~128K SLoC