You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Redis.from_pool() class method, for explicitly owning and closing a ConnectionPool (#2913)
* Add the `from_pool` argument to asyncio.Redis
* Add tests for the `from_pool` argument
* Add a "from_pool" argument for the sync client too
* Add automatic connection pool close for redis.sentinel
* use from_pool() class method instead
* re-add the auto_close_connection_pool arg to Connection.from_url()
* Deprecate the "auto_close_connection_pool" argument to Redis() and Redis.from_url()
Copy file name to clipboardExpand all lines: docs/examples/asyncio_examples.ipynb
+28-5Lines changed: 28 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,26 @@
44
44
"await connection.close()"
45
45
]
46
46
},
47
+
{
48
+
"cell_type": "markdown",
49
+
"metadata": {},
50
+
"source": [
51
+
"If you create custom `ConnectionPool` for the `Redis` instance to use alone, use the `from_pool` class method to create it. This will cause the pool to be disconnected along with the Redis instance. Disconnecting the connection pool simply disconnects all connections hosted in the pool."
"If you supply a custom `ConnectionPool` that is supplied to several `Redis` instances, you may want to disconnect the connection pool explicitly. Disconnecting the connection pool simply disconnects all connections hosted in the pool."
76
+
"\n",
77
+
"However, If you supply a `ConnectionPool` that is shared several `Redis` instances, you may want to disconnect the connection pool explicitly. use the `connection_pool` argument in that case."
0 commit comments