Skip to main content

aioredis

基础使用

安装

pip install aioredis

使用示例

基础配置

OPTIONS = {
"url": 'redis://127.0.0.1/3',

"host": '127.0.0.1',
"db": 3,
"max_connections": 20, # 连接池最大数量
"encoding": "utf-8", # utf8 编码
"decode_responses": True, # 自动转换json
}

连接池使用

pool = aioredis.ConnectionPool.from_url(**OPTIONS)