Python pylibmc 模块,ThreadMappedPool() 实例源码

我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用pylibmc.ThreadMappedPool()

项目:MCSManager-fsmodule    作者:Suwings    | 项目源码 | 文件源码
def __init__(self, *arg, **kw):
        super(PyLibMCNamespaceManager, self).__init__(*arg, **kw)

        memcache_module = kw.get('memcache_module', 'auto')
        _memcache_module = _client_libs[memcache_module]
        protocol = kw.get('protocol', 'text')
        username = kw.get('username', None)
        password = kw.get('password', None)
        url = kw.get('url')
        behaviors = parse_memcached_behaviors(kw)

        self.mc = MemcachedNamespaceManager.clients.get(
                        (memcache_module, url),
                        _memcache_module.Client,
                        servers=url.split(';'), behaviors=behaviors,
                        binary=(protocol == 'binary'), username=username,
                        password=password)
        self.pool = PyLibMCNamespaceManager.pools.get(
                        (memcache_module, url),
                        pylibmc.ThreadMappedPool, self.mc)
项目:python-group-proj    作者:Sharcee    | 项目源码 | 文件源码
def __init__(self, *arg, **kw):
        super(PyLibMCNamespaceManager, self).__init__(*arg, **kw)

        memcache_module = kw.get('memcache_module', 'auto')
        _memcache_module = _client_libs[memcache_module]
        protocol = kw.get('protocol', 'text')
        username = kw.get('username', None)
        password = kw.get('password', None)
        url = kw.get('url')
        behaviors = parse_memcached_behaviors(kw)

        self.mc = MemcachedNamespaceManager.clients.get(
                        (memcache_module, url),
                        _memcache_module.Client,
                        servers=url.split(';'), behaviors=behaviors,
                        binary=(protocol == 'binary'), username=username,
                        password=password)
        self.pool = PyLibMCNamespaceManager.pools.get(
                        (memcache_module, url),
                        pylibmc.ThreadMappedPool, self.mc)
项目:anom-py    作者:Bogdanp    | 项目源码 | 文件源码
def __init__(self, client, adapter, *, namespace="anom"):
        self.client_pool = pylibmc.ThreadMappedPool(client)
        self.adapter = adapter
        self.namespace = namespace

        self.query = self.adapter.query