Sparta memcached library
Project description
sparta-memcached
Sparta memcached library.
Usage
import pylibmc
import sparta.memcached
alice_cache = sparta.memcached.SpartaCacheWrapper(
pylibmc.Client(
["127.0.0.1:11211"],
binary=True,
behaviors={"tcp_nodelay": True, "ketama": True, "no_block": True, "cas": True}
),
key_prefix="alice/",
)
bob_cache = sparta.memcached.SpartaCacheWrapper(
pylibmc.Client(
["127.0.0.1:11211"],
binary=True,
behaviors={"tcp_nodelay": True, "ketama": True, "no_block": True, "cas": True}
),
key_prefix="bob/",
)
your_value = ...
alice_cache.set("your_key", your_value)
assert alice_cache.get("your_key") == your_value
assert alice_cache.get("your_key") != bob_cache.get("your_key")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sparta-memcached-0.2.1.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for sparta_memcached-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d1f1f6d656fd4359c2049947a0f146dca3c8567f0f01d0bdcdfd5ba27d7399d |
|
MD5 | e7bb1ac40fb26e350dec42dc11126371 |
|
BLAKE2b-256 | f114518611b28bcfb8c031557d3b1b2d31bb2f74ace16d03423161534b2b6275 |