fiorix/txredisapi — pull request #48 by ioga (2013-04-14 10:24:42+00:00)
Title: Use the free connections queue to select the connection in the pool.

Currently the factory selects the connection in the pool on a round-robin basis.

This patch adds a queue of available connections into the factory. When the connection becomes available, it's being put to the queue, and when the user needs to run the command, it's taken from the queue. That eliminates the problem of connections running blocking commands in the pool.

For example, lets assume that we have the pool of 2 connections and an empty database. Then we run
```python
pool.brpop(queue, timeout=3)
pool.set(some_key, some_value)
pool.lpush(queue, some_value)
```
Currently, due to the round-robin connection selection, the brpop will return nil/None, since the lpush command will be scheduled to the same connection, and thus it'll be only executed after the brpop timeout.