shardmap 0.3.2

Sharded embedded in-memory map with optional cache, protocol, and server internals
Documentation
use std::thread;

use shardmap::ShardCache;

fn main() {
    let cache = ShardCache::new();
    cache.insert_slice(b"counter:total", b"42");

    let prepared = cache.prepare_key(b"counter:total");
    let mut workers = Vec::new();

    for _ in 0..4 {
        let cache = cache.clone();
        let prepared = prepared.clone();
        workers.push(thread::spawn(move || {
            let value = cache.get_prepared_owned(&prepared).unwrap();
            assert_eq!(value.as_ref(), b"42");
        }));
    }

    for worker in workers {
        worker.join().unwrap();
    }
}