| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
Storage --+
|
StorageMemcache
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
| object |
|
||
| StorageResourceInfo or subclass |
|
||
| object |
|
||
| string |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
| bool |
|
||
| dict |
|
||
| tuple |
|
||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
The Memcache storage allows to use memcache as the master storage but can also be used as a proxy to another storage providing therefore a transparent and powerful cache mechanism to an application. By default it will look for the cmemcache module and if not available will fallback to the regular memcache module. The ``servers`` argument is a list of strings supporting the common format to connect to a memcached server. The ``key_generator`` is a callable that takes the arguments provided to the info() method and returns a new string used as the key within the memcached instance. It should therefore be unique. If not provided it will compute the sha (sha256 if available) hashing of the arguments provided to the info() method prefixed by the name of the collection. The ``storage``, if provided, must be an instance of another storage. Each operation on the memcache storage will then propagated to the inner cache transparently. Note that because the cmemcache module is not entirely thread safe, this storage uses a lock to synchronize the different write operations. Hopefully this should not decrease the capacity of this storage. Note also that this storage should not really be used as a standalone as its behavior varies slightly from the other storages. You should always use this as a proxy storage.
|
|
|
|
Returns the content as a string of the resource found at 'info.key'. Keyword arguments info -- as returned by info()
|
Returns the content as a string of the resource found at 'info.key'. If no resource could be found, an IOError is raised. Keyword arguments info -- as returned by info()
|
Set the content at 'info.key' of the resource. Keyword arguments info -- as returned by info() content -- data as a string object or a file object. In the latter case read() MUST return the full content as a byte string.
|
Set the content at 'info.key' of the resource. Keyword arguments info -- as returned by info() content -- data as a string or a file object. In the latter case read() MUST return the full content as a byte string.
|
Remove the resource at 'info.key' from the cache and if provided from the proxied storage. Keyword arguments info -- as returned by info()
|
Remove the resource at 'info.key' from the cache and if provided from the proxied storage. Keyword arguments info -- as returned by info()
|
|
Returns True if the resource at 'info.key' exists in either the cache or alternatively the proxied storage. Returns False otherwise. Note that because it first looks at the cache, the resource may not be present in the proxied storage and still return True creating some kind of false positive. Keyword arguments info -- as returned by info()
|
|
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Sun Feb 17 14:54:46 2008 | http://epydoc.sourceforge.net |