Memcached support for the r2d2 connection pool (Rust)

Overview

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

You might also like...
Streaming Network Overlay Connection Arbitration Tunnel

SNOCAT Streaming Network Overlay Connection Arbitration Tunnel snocat is a framework for forwarding streams across authenticated, encrypted QUIC tunne

Diesel async connection implementation

A async interface for diesel Diesel gets rid of the boilerplate for database interaction and eliminates runtime errors without sacrificing performance

An async executor based on the Win32 thread pool API

wae An async executor based on the Win32 thread pool API use futures::channel::oneshot; #[wae::main] async fn main() { let (tx, rx) = oneshot::ch

This represents staked SOL, and can be sold for wSOL in the wSOL/stSOL Liquidity Pool

This represents staked SOL, and can be sold for wSOL in the wSOL/stSOL Liquidity Pool (paying a fee to skip the unstaking cool-down period). The value of your stSOL holdings is automatically incremented each epoch when staking rewards are paid.

A lock-free, append-only atomic pool.

A lock-free, append-only atomic pool. This library implements an atomic, append-only collection of items, where individual items can be acquired and r

High-performance, lock-free local and concurrent object memory pool with automated allocation, cleanup, and verification.

Opool: Fast lock-free concurrent and local object pool Opool is a high-performance Rust library that offers a concurrent and local object pool impleme

PgBouncer rewritten in Rust, with sharding, load balancing and failover support
PgBouncer rewritten in Rust, with sharding, load balancing and failover support

PgCat Meow. PgBouncer rewritten in Rust, with sharding, load balancing and failover support. Alpha: don't use in production just yet. Local developmen

Simple and flexible queue implementation for Rust with support for multiple backends (Redis, RabbitMQ, SQS, etc.)

Omniqueue Omniqueue is an abstraction layer over queue backends for Rust. It includes support for RabbitMQ, Redis streams, and SQS out of the box. The

Sharded, concurrent mini redis that support http interface implemented in rust

Rudis A mini version of redis server that provides http interface implemented in Rust. The in-memorry kv-storage is sharded and concurrent safe. Inspi

Comments
  • 0.3.0 -> 0.3.1 has breaking changes

    0.3.0 -> 0.3.1 has breaking changes

    memcache is a public dependency, so moving it from 0.11 (in r2d2-memcache 0.3.0) to 0.13 (in r2d2-memcache 0.3.1) is a breaking change and should have been a bump to 0.4.0.

    Would it be possible to get a 0.3.2 release restoring compatibility with memcache 0.11 , and/or yanking 0.3.1?

    opened by jebrosen 3
  • Questionable performance of pool.get()

    Questionable performance of pool.get()

    Currently, I tried creating a connection pool for ascii protocol memcache cluster. Connection Pool was created successfully.

    Integrated with Restful API, and tried to invoke pool.get().unwrap() for every request to fetch from DB and provide as response. Unfortunately this is causing huge request latency. Is there a way we can poll an active connection at lesser cost pool.get().unwrap() is taking around 110ms for r2d2-memcache?

    opened by vaikzs 5
Owner
川田 恵氏 (Kawada Keishi a.k.a megumish)
Team : Harekaze、CTF(Pwn)、競プロ、機械学習 プロ:Lv.0
川田 恵氏 (Kawada Keishi a.k.a megumish)
r2d2-cypher is a r2d2 connection pool for rusted-cypher

r2d2-cypher is a r2d2 connection pool for rusted-cypher

Markus Kohlhase 10 Oct 16, 2021
rust-mysql-simple support library for the r2d2 connection pool

r2d2-mysql rust-mysql-simple support library for the r2d2 connection pool.

outersky 44 Nov 1, 2022
rust-postgres support library for the r2d2 connection pool

r2d2-postgres Documentation rust-postgres support library for the r2d2 connection pool. Example use std::thread; use r2d2_postgres::{postgres::NoTls,

Steven Fackler 128 Dec 26, 2022
LDAP support for the r2d2 connection pool

r2d2-ldap LDAP support for the r2d2 connection pool Install Add this to your Cargo.toml: [dependencies] r2d2-ldap = "0.1.1" Basic Usage use std::threa

Aitor Ruano 2 Nov 7, 2020
Oracle support for the r2d2 connection pool

r2d2-oracle The documentation can be found on docs.rs. Oracle support for the r2d2 connection pool. This fits in between the r2d2 connection manager a

Ralph Ursprung 7 Dec 14, 2022
ODBC adapter for r2d2 connection pool

ODBC adapter for r2d2 connection pool

Konstantin V. Salikhov 9 Nov 3, 2021
Skytable rust client support library for the bb8 connection pool

bb8-skytable Skytable rust client support library for the bb8 connection pool. Heavily based on bb8-redis Basic usage example use bb8_skytable::{

null 3 Sep 18, 2021
A generic connection pool for Rust

r2d2 A generic connection pool for Rust. Documentation Opening a new database connection every time one is needed is both inefficient and can lead to

Steven Fackler 1.2k Jan 8, 2023
Quick Pool: High Performance Rust Async Resource Pool

Quick Pool High Performance Rust Async Resource Pool Usage DBCP Database Backend Adapter Version PostgreSQL tokio-postgres qp-postgres Example use asy

Seungjae Park 13 Aug 23, 2022
Lightweight async Redis client with connection pooling written in pure Rust and 100% memory safe

redi-rs (or redirs) redi-rs is a Lightweight Redis client with connection pooling written in Rust and 100% memory safe redi-rs is a Redis client writt

Oğuz Türkay 4 May 20, 2023