Skip to content

Full-featured async (tokio-based) redis cluster connection pool (like r2d2)

License

Notifications You must be signed in to change notification settings

wizpra/bb8-redis-cluster

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bb8-redis-cluster

A Async redis cluster connection pool (bb8).

Example

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

    for _ in 0..20 {
        let pool = pool.clone();
        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);
        });
    }
}

About

Full-featured async (tokio-based) redis cluster connection pool (like r2d2)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%