V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
jason0916
V2EX  ›  Python

[python] aredis —— 一款 redis 的异步客户端

  •  
  •   jason0916 ·
    NoneGG · 2017-01-03 15:00:54 +08:00 · 3046 次点击
    这是一个创建于 2676 天前的主题,其中的信息可能已经有所发展或是发生改变。

    背景

    aredis 是一款由 redis-py 改写而成的 Python redis 客户端

    改动

    主要重写了底部建立连接和读取数据部分的代码,对于接口部分除了 iter 相关的代码暂时不可用以外都向下兼容,便于使用者从 redis-py 的同步代码迁移到 async 和 await 的协程版本( Python 3.5 中不支持在 async 定义的函数下使用 yield, Python 3.6 可以,后续会加上)

    优势

    相比于现有的两款支持 async/await 的 redis 客户端来说:

    aioredis 要求装上 hiredis , aredis 可以不需要相关依赖地运行,速度上两者持平且都可以使用 hiredis 来作为 parser ,用 uvloop 代替 asyncio 的 eventloop 来加速

    asyncio_redis aredis 速度上领先于 asyncio_redis

    劣势

    现在对于编码的支持还不是那么完善,大部分命令还是用 bytes 类型作为返回值,且目前只支持 Python 3.5 及以上的版本

    前排求 star 和 pr
    第 1 条附言  ·  2017-01-03 16:28:00 +08:00
    第一次发推广贴,有点紧张了,连项目地址都没贴 orz
    项目地址: https://github.com/NoneGG/aredis
    4 条回复    2023-02-21 09:56:19 +08:00
    jason0916
        1
    jason0916  
    OP
       2017-01-03 15:01:37 +08:00
    貌似有点歧义,是相对于 asyncio_redis 来说速度上领先
    jason0916
        2
    jason0916  
    OP
       2017-01-03 16:25:18 +08:00
    jason0916
        3
    jason0916  
    OP
       2017-01-03 16:25:32 +08:00
    第一次发这种推广贴,有点紧张了 orz
    MRlaopeng
        4
    MRlaopeng  
       2023-02-21 09:56:19 +08:00
    追更
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2340 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 15:02 · PVG 23:02 · LAX 08:02 · JFK 11:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.