本文整理汇总了Python中pymemcache.client.base.Client.sock方法的典型用法代码示例。如果您正苦于以下问题:Python Client.sock方法的具体用法?Python Client.sock怎么用?Python Client.sock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymemcache.client.base.Client
的用法示例。
在下文中一共展示了Client.sock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_client_pool
# 需要导入模块: from pymemcache.client.base import Client [as 别名]
# 或者: from pymemcache.client.base.Client import sock [as 别名]
def make_client_pool(self, hostname, mock_socket_values,
serializer=None, **kwargs):
mock_client = Client(hostname, serializer=serializer, **kwargs)
mock_client.sock = MockSocket(mock_socket_values)
client = PooledClient(hostname, serializer=serializer)
client.client_pool = pool.ObjectPool(lambda: mock_client)
return mock_client
示例2: make_client
# 需要导入模块: from pymemcache.client.base import Client [as 别名]
# 或者: from pymemcache.client.base.Client import sock [as 别名]
def make_client(self, mock_socket_values, **kwargs):
client = Client(None, key_prefix=b"xyz:", **kwargs)
client.sock = MockSocket(list(mock_socket_values))
return client
示例3: make_client
# 需要导入模块: from pymemcache.client.base import Client [as 别名]
# 或者: from pymemcache.client.base.Client import sock [as 别名]
def make_client(self, mock_socket_values, serializer=None):
client = Client(None, serializer=serializer)
client.sock = MockSocket(list(mock_socket_values))
return client