abersheeran / asgi-ratelimit

A ASGI Middleware to rate limit
Apache License 2.0
292 stars 11 forks source link

Switch to aioredis 2 #50

Closed euri10 closed 2 years ago

euri10 commented 2 years ago

Choosing a redis client library is a nightmare, this is a draft PR to switch to aioredis 2

Reasoning is that aredis seems to be not used a lot anymore, 611 stars, last release almost 2y ago, latest issue to date is a link to a fork aioredis v2 (https://github.com/aio-libs/aioredis-py) has 2k stars, is pretty active

question is performance wise how it stands, I cant prononce on that, aioredis readme has a link to this repo that compares libraries (https://github.com/popravich/python-redis-benchmark) but if you look correctly it is testing the old aioredis lib (v1.1.1) and the new major 2 is a complete rewrite so hard to say.

abersheeran commented 2 years ago

I almost forgot about this. I sent an email asking about aredis in January last year and got no response. I guess he should be too busy with work to maintain this open source project.

abersheeran commented 2 years ago

Please sync from master branch to fixed the CI when you are free.

euri10 commented 2 years ago

I'm gonna close this, I see arq abandonned aioredis 1.3, didn't switch to aioredis 2 and use now redis-py 4.2.0rc2 (https://github.com/samuelcolvin/arq/issues/250#issuecomment-1063103662) So we'll probably should do the same, what do you think @abersheeran ? Following redis libraries in python when it's not your day to day job is difficult !

abersheeran commented 2 years ago

Cool! I found it https://redis-py.readthedocs.io/en/latest/examples/asyncio_examples.html

Using redis.py is a great idea, I can't wait for the release of 4.2.0.😀