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.2.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for sparta_memcached-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bf7da848f35aaf31ffa7c29bce012ebef0b1cf4a48e9ae53d7b79b1c4a83677 |
|
MD5 | c7f9d5e203041274cd07be759e74d89d |
|
BLAKE2b-256 | 361bd9fdf0a4cbb3c173d6864ba9c432ad4125b11463dc15ccc9d9dd80227acc |