3 releases (breaking)

new 0.3.0 Jan 10, 2025
0.2.0 Feb 14, 2023
0.1.0 Feb 12, 2023

#1860 in Asynchronous

Download history 297/week @ 2024-09-25 167/week @ 2024-10-02 306/week @ 2024-10-09 244/week @ 2024-10-16 4/week @ 2024-10-23 1/week @ 2024-10-30 1/week @ 2024-11-06 161/week @ 2025-01-08

161 downloads per month

MIT license

8KB
98 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.

Versions

  • v0.2.x - amqprs 0.9.x
  • v0.3.x - amqprs 0.10.x

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–12MB
~131K SLoC