安装
最简单的安装方式:
pip install aioredis
需要先安装的依赖:
- Python 3.3 and asyncio 或 Python 3.4+
- hiredis
例子
simple low-level interface:
import asyncio
import aioredis
loop = asyncio.get_event_loop()
async def go():
conn = await aioredis.create_connection(
('localhost', 6379), loop=loop)
await conn.execute('set', 'my-key', 'value')
val = await conn.ex