#memcached #cache #memcache

bb8-memcached

async connection pool for memcached, based on bb8 and memcache-async

5 releases (breaking)

0.5.0 Aug 23, 2022
0.4.0 Jul 27, 2021
0.3.0 Feb 16, 2021
0.2.0 Feb 16, 2021
0.1.0 Jun 2, 2020

#243 in Caching

Download history 25/week @ 2024-07-29 13/week @ 2024-08-05 16/week @ 2024-08-12 5/week @ 2024-08-19 14/week @ 2024-08-26 8/week @ 2024-09-02 21/week @ 2024-09-09 18/week @ 2024-09-16 37/week @ 2024-09-23 24/week @ 2024-09-30 38/week @ 2024-10-07 47/week @ 2024-10-14 36/week @ 2024-10-21 21/week @ 2024-10-28 43/week @ 2024-11-04 18/week @ 2024-11-11

141 downloads per month

MIT license

12KB
223 lines

bb8-memcached

bb8 adaptor for memcached, based on memcache-async

License

MIT


lib.rs:

Memcached support for the bb8 connection pool.

Example

use futures::future::join_all;
use bb8_memcached::{bb8, MemcacheConnectionManager};

#[tokio::main]
async fn main() {
    let manager = MemcacheConnectionManager::new("tcp://localhost:11211").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 version = conn.version().await.unwrap();
        }));
    }

    join_all(handles).await;
}

Dependencies

~5–14MB
~170K SLoC