mobc

A generic connection pool, but async/.await

Build Status crates.io

Documentation

Note: mobc requires at least Rust 1.39.

Features

Adapter

Usage

If you are using tokio 0.2-alpha.6, use mobc 0.2.10.

toml [dependencies] mobc = "0.3.0"

foo demo

```rust use tokio;

[tokio::main]

async fn main() { let manager = mobcfoodb::FooConnectionManager::new("localhost:1234"); let pool = mobc::Pool::builder() .maxsize(15) .build(manager) .await .unwrap();

for _ in 0..20 {
    let pool = pool.clone();
    tokio::spawn(async {
        let conn = pool.get().await.unwrap();
        // use the connection
        // it will be returned to the pool when it falls out of scope.
    });
}

}

```