• Nathan Harris's avatar
    Allow repeated commands to same connection in pool · 42e8d4b1
    Nathan Harris authored
    Some Redis commands are very connection specific that have impacts on future access that makes it difficult in the current
    checkout-use-return cycle that `RedisConnectionPool` uses.
    Developers need a way to borrow a specific connection, chain several commands together, and then return the connection to the pool.
    - Add: `leaseConnection` method to `RedisConnectionPool` which provides a connection from the pool and returns it after a provided closure's ELF resolves
    - Add: `allowSubscriptions` property to `RedisConnection` for controlling the ability to make PubSub subscriptions
    - Add: `RedisClientError.pubsubNotAllowed` case for when `RedisConnection.allowSubscriptions` is set to `false` and a subscription was still attempted
    Developers should now have an "escape hatch" with `RedisConnectionPool` to do limited exclusive chains of operations on a specific connection.
Code owners : Nathan Harris