| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds redis.selector, a module that provides the best selector strategy
available on the current platform. A redis.selector polls a socket to
provide two pieces of functionality:
1. Check whether data can be read from the socket. Prior versions of redis-py
provided this behavior with just select.select(). select() has lots of
limitations, most notably a limit of ~1024 file descriptors. Now that
better selectors are available, this should make can_read() faster and
able to accomodate more clients. See #1115 and #486
2. Check whether a socket is ready for a command to be sent. This doubles
as a health check. It ensures that the socket is available for writing,
has no data to read and has no known errors. Anytime a socket is
disconnected or hung up, data is available to be read, typically zero bytes.
ConnectionPool.get_connection has been modified to ensure that connections
it returns are connected and are ready for a command to be sent. If
get_connection encounters a case where a socket isn't ready for a command
the connection is reconnected and checked again.
TODO: more tests for this stuff. implement EPoll and KQueue selectors.
Fixes #1115
Fixes #486
|
|
|
|
|
| |
Fixes #969
Fixes #961
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
redis-py maintained backwards compatibility by keeping the old "Redis"
class around for quite some time. While no doubt a convenience for folks
who relied on it, the presence of both Redis and StrictRedis causes
a number of support issues and general confusion. With 3.0, we're
breaking a few things to make redis-py better going forward.
This change removes the old Redis class. We also renamed the StrictRedis
class to Redis and aliased StrictRedis to Redis. For people that have
been using StrictRedis, this should not change anything. You can continue
doing things as you are.
People still using the legacy Redis class will need to update the argument
order for the SETEX, LREM and ZADD commands. Additionally, the return values
for TTL and PTTL now return the integer values -1 when a key exists but
has no expire time and -2 when a key does not exist. Previously these
cases returned a None value in the Redis class.
|
|
|
|
| |
All supported Python versions support the with statement.
|
|
|
|
|
| |
Previously ConnectionPool.from_url kept it as a string, causing a 'ValueError:
"max_connections" must be a positive integer'.
|
| |
|
|
|
|
|
| |
Previously if a value for socket_timeout was supplied as part fo the URL an error would be raised when a socket was created with an invalid type, this change fixes that by parsing `socket_timeout`, `socket_connect_timeout` to float values.
In addition the boolean values `socket_keepalive` and `retry_on_timeout` are parsed to bool types taking into account the usage of True/False, Yes/No strings.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
StrictRedis.from_url() now creations a connection pool instance and
passes that as the connection_pool argument to the client class.
Cleaned up the test suite for URL parsing and BlockingConnectionPool tests
|
|\
| |
| |
| |
| | |
Conflicts:
tests/test_connection_pool.py
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ability to parse UNIX domain socket URLs
* add redis.connection.parse_url()
* moved code from StrictRedis.from_url() to here
* add ability to parse UNIX domain socket URLs
* return keyword args to pass to StrictRedis.__init__()
* StrictRedis.from_url() - call parse_url() to get keyword args
* add classmethod from_url() to ConnectionPool and BlockingConnectionPool
* get keyword args from parse_url()
* touch up keyword args from StrictRedis format for connection pool
* tests/test_connection_pool.py
* add from_url() tests for ConnectionPool and BlockingConnectionPool
* add from_url() tests for a single Redis client object
|
| |
| |
| |
| |
| | |
Any attempt to reconnect will force all connections in that pool to update
their connections to the new master. Fixes #435
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
| |
ConnectionPool, and BlockingConnectionPool
|
| |
|
|
|
|
| |
Fixes #368
|
| |
|
|
|