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.1.4.tar.gz
(6.2 kB
view hashes)
Built Distribution
Close
Hashes for sparta_memcached-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e2ef574ccb1733ce8c5d7e6462151c5d6c9312e5b961c2fb3a466fd05bf86e5 |
|
MD5 | d8ee1206ff83923758e20aba58df945b |
|
BLAKE2b-256 | 3d1e92c73812913bb8aa8330e7ac4a9c955032b111a87e4cbea85a646214a8b5 |