Sparta memcached library
Project description
sparta-memcached
Sparta memcached library.
Usage
import pylibmc
import sparta.memcached
alice_cache = sparta.memcached.KeyPrefixWrapper(
pylibmc.Client(
["127.0.0.1:11211"],
binary=True,
behaviors={"tcp_nodelay": True, "ketama": True, "no_block": True},
),
key_prefix="alice/",
)
bob_cache = sparta.memcached.KeyPrefixWrapper(
pylibmc.Client(
["127.0.0.1:11211"],
binary=True,
behaviors={"tcp_nodelay": True, "ketama": True, "no_block": 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.0.8.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for sparta_memcached-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 718957c6013f7ccea5979b205b20ecec29a557d669208ef44e2bb5f400771a67 |
|
MD5 | 0e0ebbb944e25e4f575c0c245734f066 |
|
BLAKE2b-256 | 6b26a4ec55398455f643652b6dbb1826048ada333579c6443ce3b19c0cc46532 |