foxtive 0.25.6

Foxtive Framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::prelude::AppResult;
use crate::rabbitmq::config::RabbitmqConfig;
use anyhow::Error;
use deadpool_lapin::{Manager, Pool};

pub async fn create_rmq_conn_pool(config: RabbitmqConfig) -> AppResult<Pool> {
    let manager = Manager::new(config.dsn, config.conn_props);

    Pool::builder(manager)
        .config(config.pool_config)
        .build()
        .map_err(Error::msg)
}