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.
§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`.
}Re-exports§
pub use config::Config;pub use config::ConfigError;pub use amqprs;
Modules§
Structs§
- Manager
Managerfor creating and recyclingamqprsconnections.- Metrics
- Statistics regarding an object returned by the pool
- Object
Id - A unique identifier for an object within a pool.
- Pool
Config Poolconfiguration.- Status
- The current pool status.
- Timeouts
- Timeouts when getting
Objects from aPool.
Enums§
- Runtime
- Enumeration for picking a runtime implementation.
- Timeout
Type - Possible steps causing the timeout in an error returned by
Pool::get()method.
Type Aliases§
- Build
Error - Type alias for using
deadpool::managed::BuildErrorwithamqprs. - Connection
- Type alias for
Objectin case Object isn’t straight foward enough. - Create
Pool Error - Type alias for using
deadpool::managed::CreatePoolErrorwithamqprs. - Hook
- Type alias for using
deadpool::managed::Hookwithamqprs. - Hook
Error - Type alias for using
deadpool::managed::HookErrorwithamqprs. - Object
- Type alias for using
deadpool::managed::Objectwithamqprs. - Pool
- Type alias for using
deadpool::managed::Poolwithamqprs. - Pool
Builder - Type alias for using
deadpool::managed::PoolBuilderwithamqprs. - Pool
Error - Type alias for using
deadpool::managed::PoolErrorwithamqprs. - Weak
Pool - Type alias for using
deadpool::managed::Poolwithamqprs.