Python asyncio 的 Redis 客户端 asyncio-redis

码农软件 · 软件分类 · 常用工具包 · 2019-08-17 14:57:25

软件介绍

asyncio-redis 是 Python asyncioRedis 客户端 (PEP 3156)。这个 Redis 库是完全异步的,Reids 服务器非阻塞客户端,依赖于 asyncio,所以要求 Python 3.3. 或者 Python 3.4。

连接示例:

import asyncio
import asyncio_redis
@asyncio.coroutine
def example():
    # Create Redis connection
    connection = yield from asyncio_redis.Connection.create(host='localhost', port=6379)
    # Set a key
    yield from connection.set('my_key', 'my_value')
    # When finished, close the connection.
    connection.close()
if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(example())

本文地址:https://www.codercto.com/soft/d/12568.html

Tales from Facebook

Tales from Facebook

Daniel Miller / Polity Press / 2011-4-1 / GBP 55.00

Facebook is now used by nearly 500 million people throughout the world, many of whom spend several hours a day on this site. Once the preserve of youth, the largest increase in usage today is amongst ......一起来看看 《Tales from Facebook》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具