All Projects → jaysonsantos → bmemcached-rs

jaysonsantos / bmemcached-rs

Licence: MIT License
Rust binary memcached implementation

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to bmemcached-rs

memcache
Node.js memcached client with the most efficient ASCII protocol parser
Stars: ✭ 26 (+8.33%)
Mutual labels:  memcached
lonlat bng
A multithreaded Rust library with FFI for converting WGS84 longitude and latitude coordinates into BNG (OSGB36) Eastings and Northings and vice versa (using OSTN15)
Stars: ✭ 20 (-16.67%)
Mutual labels:  rust-library
bitrix-memcached
Bitrix Cache with php-memcached / Кэш Битрикс на Memcached
Stars: ✭ 13 (-45.83%)
Mutual labels:  memcached
harsh
Hashids implementation in Rust
Stars: ✭ 48 (+100%)
Mutual labels:  rust-library
vpsearch
C library for finding nearest (most similar) element in a set
Stars: ✭ 27 (+12.5%)
Mutual labels:  rust-library
memcached-php
Memcached client library in plain vanilla PHP.
Stars: ✭ 28 (+16.67%)
Mutual labels:  memcached
telnet-rs
A simple implementation of Telnet in Rust.
Stars: ✭ 35 (+45.83%)
Mutual labels:  rust-library
magento-cluster
Highly Available and Auto-scalable Magento Cluster
Stars: ✭ 21 (-12.5%)
Mutual labels:  memcached
WP-Stash
Bridge between WordPress and StashPHP, providing a PSR6-compliant caching system for WordPress
Stars: ✭ 31 (+29.17%)
Mutual labels:  memcached
fastapi-cache
fastapi-cache is a tool to cache fastapi response and function result, with backends support redis and memcached.
Stars: ✭ 375 (+1462.5%)
Mutual labels:  memcached
rust-rgb
struct RGB for sharing pixels between crates
Stars: ✭ 70 (+191.67%)
Mutual labels:  rust-library
rust-lp-modeler
Lp modeler written in Rust
Stars: ✭ 75 (+212.5%)
Mutual labels:  rust-library
trickster
user-friendly linux memory hacking library
Stars: ✭ 50 (+108.33%)
Mutual labels:  rust-library
django-pymemcache
A Django cache backend built in Pinterest's pymemcache.
Stars: ✭ 40 (+66.67%)
Mutual labels:  memcached
shell-scripts
my-scripts
Stars: ✭ 87 (+262.5%)
Mutual labels:  memcached
blinkt
A Rust library for the Pimoroni Blinkt!, and any similar APA102 or SK9822 LED strips or boards, on a Raspberry Pi.
Stars: ✭ 18 (-25%)
Mutual labels:  rust-library
serial test
Allows for the creation of serialised Rust tests
Stars: ✭ 105 (+337.5%)
Mutual labels:  rust-library
warc
⚙️ A Rust library for reading and writing WARC files
Stars: ✭ 26 (+8.33%)
Mutual labels:  rust-library
php-mvc
PHP MVC ⦿ Dockerized • Composer • RESTful API • Memcached • cron • WebSocket
Stars: ✭ 17 (-29.17%)
Mutual labels:  memcached
EnyimMemcachedCore
A Memcached client for .NET Core. Available on Nuget https://www.nuget.org/packages/EnyimMemcachedCore
Stars: ✭ 143 (+495.83%)
Mutual labels:  memcached

bmemcached-rs

Build Status Build status

Rust binary memcached implementation (ON GOING)

Usage

extern crate bmemcached;

use std::sync::Arc;
use std::thread;

use bmemcached::MemcachedClient;

fn main() {
    // Use arc for threading support
    let client = Arc::new(MemcachedClient::new(vec!["127.0.0.1:11211"], 5).unwrap());

    // Traits examples
    let value = "value";
    client.set("string", value, 1000);
    let rv: String = client.get("string").unwrap();
    assert_eq!(rv, "value");

    client.set("integer", 10 as u8, 1000);
    let rv: u8 = client.get("integer").unwrap();
    assert_eq!(rv, 10 as u8);

    // Threads example
    let mut threads = vec![];
    for i in 0..4 {
        let client = client.clone();
        threads.push(thread::spawn(move || {
            let data = format!("data_n{}", i);
            client.set(&data, &data, 100).unwrap();
            let val: String = client.get(&data).unwrap();
            client.delete(&data).unwrap();
            val
        }));
    }
    for (i, thread) in threads.into_iter().enumerate() {
        let result = thread.join();
        assert_eq!(result.unwrap(), format!("data_n{}", i));
    }
}

Why

I am trying to learn rust by reimplementing a python project that I wrote.

What works

  • Add
  • Set
  • Replace
  • Get
  • Delete
  • Increment
  • Decrement
  • Consistent Hashing
  • Threading Support

Trait usage

On all supported functions we use traits to be able to send any type of values to memcached.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].