Skip to main content

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


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sparta_memcached-0.2.2-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file sparta-memcached-0.2.2.tar.gz.

File metadata

  • Download URL: sparta-memcached-0.2.2.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for sparta-memcached-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ba51020b0e9e1a6ec0ef2c8b5236c5af2efddde27aaca10e722c15ed80fde106
MD5 0a8c0b127907b376faba6b8d59c1ffcc
BLAKE2b-256 e553f5c5f7c16e955ba8f7b979b06c6bdcd30ba4088089fc7e64bc45ce385bca

See more details on using hashes here.

File details

Details for the file sparta_memcached-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for sparta_memcached-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9bf7da848f35aaf31ffa7c29bce012ebef0b1cf4a48e9ae53d7b79b1c4a83677
MD5 c7f9d5e203041274cd07be759e74d89d
BLAKE2b-256 361bd9fdf0a4cbb3c173d6864ba9c432ad4125b11463dc15ccc9d9dd80227acc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page