bb8-redis 0.8.1

Full-featured async (tokio-based) redis connection pool (like r2d2)
docs.rs failed to build bb8-redis-0.8.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: bb8-redis-0.15.0

Redis support for the bb8 connection pool.

Example

use futures_util::future::join_all;
use bb8_redis::{
bb8,
redis::{cmd, AsyncCommands},
RedisConnectionManager
};

#[tokio::main]
async fn main() {
let manager = RedisConnectionManager::new("redis://localhost").unwrap();
let pool = bb8::Pool::builder().build(manager).await.unwrap();

let mut handles = vec![];

for _i in 0..10 {
let pool = pool.clone();

handles.push(tokio::spawn(async move {
let mut conn = pool.get().await.unwrap();

let reply: String = cmd("PING").query_async(&mut *conn).await.unwrap();

assert_eq!("PONG", reply);
}));
}

join_all(handles).await;
}