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},
),
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},
),
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.1.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for sparta_memcached-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d987c286f5dcab6b30541420eb8baf3824d1d0d14afe1316681a40eab1aaba5 |
|
MD5 | fec8c24de6249253509d9dc144648ad6 |
|
BLAKE2b-256 | 2e4feb4a1d5ebfa07ea11e82c6e2fd483171c8185e3d5197971610b60b5657ee |