Deadpool is a dead simple async pool for connections and objects of any type.
This crate implements a deadpool
manager for lapin
.
| Feature | Description | Extra dependencies | Default |
| ------- | ----------- | ------------------ | ------- |
| config
| Enable support for config crate | config
, serde/derive
| yes |
```rust use deadpool_lapin::Config; use lapin::{ options::BasicPublishOptions, BasicProperties };
async fn main() { let cfg = Config::fromenv("AMQP").unwrap(); let pool = cfg.createpool(); for i in 1..10 { let mut connection = pool.get().await.unwrap(); let channel = connection.createchannel().await.unwrap(); channel.basicpublish( "", "hello", BasicPublishOptions::default(), b"hello from deadpool".to_vec(), BasicProperties::default() ).await.unwrap(); } } ```
Licensed under either of
at your option.