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
141 downloads per month
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