(aio)REDIS wrapper to deal with cluster redirect exceptions (`MOVED`).
Project description
(aio)REDIS wrapper to deal with cluster redirect exceptions MOVED
Like
redis.exceptions.ResponseError: MOVED 4085 10.213.192.152:6379
With this exception REDIS tells that you should repeat your request for the specified host.
That happens
- your REDIS configuration just wrong
- you connect to the wrong host
- you are using multi-node REDIS cluster - you should use my wrapper
First case is simple - just check your settings.
Second case could happen if for example you are using Amazon managed REDIS (elastic cache) for which Amazon provides fixed DNS name for configuration node, and just an IP for the work node. The IP can change in the future. So you better use this fixed DNS name, but it cannot process requests and will redirect you to the work node.
And for the third case you could use my wrapper to automatically switch between REDIS nodes (shards of you REDIS data).
My wrapper catch the "MOVED" exception and change REDIS address according to the address in the exception.
It just proxy all the REDIS methods. In this early version it is doing that dynamically, so code autocomplete won't work, sorry.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for redis_redirect-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ad5e8cdcad0f86b5be1420cf3890f5feef77f1782b4cb8f7b72adfa06ee3daf |
|
MD5 | 3862fae8873366e85fd2040cb73faf56 |
|
BLAKE2b-256 | c52ee2de99d647fa7478d073b06f44e08b4e622aac94cbdbc4d20d2f20111ea1 |