Memcached
=========

IWMemcachedClient is registered via zcml.
To use it, we need the cache name space and the IIWMemcachedClient interface::

    >>> from iw.cache import testing
    >>> testing.clearZCML()
    >>> from iw.cache.interfaces import IIWMemcachedClient
    >>> ns = 'iw.cache.test.memcached'

Then we can use get_storage to get the cache utility for the name space::

    >>> from iw.cache.utils import get_storage
    >>> cache = get_storage(ns=ns, storage=IIWMemcachedClient)
    >>> print cache.servers
    ['127.0.0.1:11211']

Typical caching::

    >>> key = cache.set('value', 'key')
    >>> cache.get('key')
    'value'

With stats::

    >>> cache.getStatistics()[0][0]
    '127.0.0.1:11211 (1)'

Clearing cache::

    >>> cache.invalidateAll()

