Crates.io | remotecache |
lib.rs | remotecache |
version | 0.0.0 |
source | src |
created_at | 2023-08-05 19:05:39.9195 |
updated_at | 2023-08-05 19:05:39.9195 |
description | A general purpose cache with possibly multiple remote servers for storing and retrieving data. |
homepage | |
repository | |
max_upload_size | |
id | 936727 |
size | 214,538 |
A general purpose cache with possibly multiple remote servers for storing and retrieving data.
The cache includes both type-mapped and namespaced APIs. Caching can be done in-memory or persistently via a cache server that manages a filesystem cache. The cache also supports caching across several cache servers.
use cache::{persistent::client::{Client, ClientKind}, error::Error, Cacheable};
let client = Client::with_default_config(ClientKind::Local, "http://127.0.0.1:28055");
fn generate_fn(tuple: &(u64, u64)) -> u64 {
tuple.0 + tuple.1
}
let handle = client.generate("example.namespace", (5, 6), generate_fn);
assert_eq!(*handle.get(), 11);