chula.cache – Wrapper module for upstream memcache.py

cache.ENCODING

Encoding to be used with memcache keys. Default value is ASCII

cache.SANITIZE

Should invalid characters in the key be removed. Default is False

class cache.Cache(servers)

Takes a list of two element tuples representing a memcached cluster

static clean_key(key, sanitize=SANITIZE)

Return a valid key encoded via ENCODING. Sanitization of illegal caracters from the key will be performed if sanitize is True. If the key is too long, or sanitize is False and illegal characters are found in the key, an error.InvalidCacheKeyError exception will be raised.

close()

Close client connection to server.

delete(key)

Delete key from the cluster, returning True if deleted, False if not.

get(key)

Fetch the value in memcache associated with key.

purge(key)

Alias for delete().

set(key, value)

Set value in the memcache cluster using key. Returns True if successfully persisted, else returns False.

stats()

Return a list of stats per server.

Previous topic

Modules

Next topic

chula.collection – Collection package

This Page