本文整理汇总了Python中pool.Pool.delete方法的典型用法代码示例。如果您正苦于以下问题:Python Pool.delete方法的具体用法?Python Pool.delete怎么用?Python Pool.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pool.Pool
的用法示例。
在下文中一共展示了Pool.delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PoolTest
# 需要导入模块: from pool import Pool [as 别名]
# 或者: from pool.Pool import delete [as 别名]
class PoolTest(AsyncTestCase):
def setUp(self):
super(PoolTest, self).setUp()
self.pool = Pool(['127.0.0.1:11211', '127.0.0.1:11212'], debug=True)
@gen_test
def test_set_get_multi(self):
res = yield self.pool.set_multi({'key1': 'test1', 'key2': 'test2', 'key3': 'test3', 1: '3', 2: 2}, 10, key_prefix="multi_")
print res
assert res == []
res = yield self.pool.get_multi(['key1', 'key2', 'key3', 1, 2], key_prefix='multi_')
print res
assert res == {'key1': 'test1', 'key2': 'test2', 'key3': 'test3', 1: '3', 2: 2}
yield self.pool.delete("multi_key1")
res = yield self.pool.get_multi(['key1', 'key2', 'key3'], key_prefix='multi_')
print res
assert res == {'key2': 'test2', 'key3': 'test3'}
print "--------------"
yield self.pool.set_multi({"list": ['a', 'b', 2], "dict": {1: 'a', 'c': 'that is fun', 'info': {1: 3}}}, 10, key_prefix="multi_")
res = yield self.pool.get_multi(['list', 'dict'], key_prefix="multi_")
print res
print type(res)