Comments (4)
Oh, well)
- First of all I tried to make it simplier -- asyncio_redis implements
asyncio.Protocol
(lots of code) vs aioredis usesasyncio.StreamReader
/StreamWriter
(no protocol code; just read & send); - At the moment when I started aioredis asyncio-redis had no
hiredis
parser. - asyncio_redis API forces end-user to work with one type of data, ie only bytes or only unicode or etc. So you would receive an error trying to mix data types, say
set('unicode_key', b'encoded_bytes_data')
. - asyncio-redis has no way to execute raw command; aioredis provides
execute
method so you'll be able to use new redis commands before their shortcuts/API implemented by client lib. - "automatic reconnections", well, in asyncio-redis if the server has gone away would reconnect, reconnect and reconnect. I mean reconnection is done as soon as connection is lost which is bad. For instance we had functional tests infrastructure where we were starting & shutting down standalone redis server instance so after all tests we had several hundreds of spamy errored 'reconnect' messages.
- aioredis doesn't have pub/sub yet, but it is in progress and will be implemented soon.
from aioredis-py.
How does aioredis handle disconnections ?
I'm having trouble with asyncio-redis not closing connections.
Redis says it has reached the max number of clients. But most of them are ghosts.
Do you think aioredis is better at handling those ?
Also, does aioredis support async with
?
from aioredis-py.
@lux-lth I suggest you open a new issue - connection pool leaks sound like a bug. And on the off chance it's a misuse of the connection pool, improved documentation from the issue resolution would help others.
from aioredis-py.
Hi, @lux-lth ,
aioredis handles connections well — drops closed, opens new when needed, reuse already opened. All that is handled by aioredis.ConnetionsPool
.
You should check aioredis.create_redis_pool.
Also, does aioredis support
async with
?
It is supported in terms of acquiring connection from pool and releasing it back,
so that no other coroutine will use same connection (this is mostly needed if you want to send some blocking command). Is this what you asked?
from aioredis-py.
Related Issues (20)
- docs:: Add stream snippet in the docs
- Aws redis 'Connection closed by server' exception occurs in my program running in aws ecs fargate
- Redis.zrevrangebyscore was wrong
- aioredis.exceptions.ResponseError: wrong number of arguments for 'hset' command HOT 1
- Sentinel cannot select db! HOT 1
- Add `nx`, `xx`, `gt` and `lt` to `.expire` HOT 1
- ConnectionError: OSError: File name too long when specifying ssl_ca_certs HOT 1
- RuntimeError: There is no current event loop in thread 'MainThread'. HOT 2
- zrevrangebyscore in aioredis in different than in redis HOT 2
- aioredis: await wasn't used with future
- Timeout Error 110, Can reconnections be handled gracefully?
- 2.0.1: pytest is failing HOT 2
- Library not works with Python 3.11 HOT 3
- Archive project? HOT 10
- pubsub.get_message(blocking_timeout) don't work with async_timeout.timeout HOT 2
- TypeError: duplicate base class TimeoutError HOT 2
- coroutine 'Connection.disconnect' was never awaited
- python3.7 import aioredis faild
- Too many simultaneous connections
- Add support for Python 3.11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aioredis-py.