Crate deadpool_amqprs

source ·
Expand description

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`.
}

Re-exports

pub use amqprs;
pub use config::Config;
pub use config::ConfigError;

Modules

Structs

Manager for creating and recycling amqprs connections.
Statistics regarding an object returned by the pool
Pool configuration.
The current pool status.
Timeouts when getting Objects from a Pool.

Enums

Enumeration for picking a runtime implementation.

Type Definitions

Type alias for Object in case Object isn’t straight foward enough.
Type alias for using deadpool::managed::Hook with amqprs.
Type alias for using deadpool::managed::Object with amqprs.
Type alias for using deadpool::managed::Pool with amqprs.