Skip to content

Memcached support for the r2d2 connection pool (Rust)

License

Notifications You must be signed in to change notification settings

megumish/r2d2-memcache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

r2d2-memcache

Build Status Latest Version Docs

Install

Add this to your Cargo.toml:

[dependencies]
r2d2-memcache = "0.2.0"

Basic Usage

extern crate r2d2_memcache;

fn main() {
    let manager = r2d2_memcache::MemcacheConnectionManager::new("memcache://localhost:11211");
    let pool = r2d2_memcache::r2d2::Pool::builder().max_size(15).build(manager).unwrap();

    let mut conn = pool.get().unwrap();
    conn.flush().unwrap();
    let value = "bar";
    conn.set("foo_get", value, 10).unwrap();
    let result: String = conn.get("foo_get").unwrap().unwrap();
    assert!(result == "bar");
}

License

About

Memcached support for the r2d2 connection pool (Rust)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages