Skip to content

Commit 5090875

Browse files
authored
Update asyncio_examples.ipynb (#3125)
clarified wording + one case of deprecated .close() changed to .aclose()
1 parent ddff7b5 commit 5090875

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/examples/asyncio_examples.ipynb

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"\n",
1616
"## Connecting and Disconnecting\n",
1717
"\n",
18-
"Utilizing asyncio Redis requires an explicit disconnect of the connection since there is no asyncio deconstructor magic method. By default, a connection pool is created on `redis.Redis()` and attached to this `Redis` instance. The connection pool closes automatically on the call to `Redis.aclose` which disconnects all connections."
18+
"Using asyncio Redis requires an explicit disconnect of the connection since there is no asyncio deconstructor magic method. By default, an internal connection pool is created on `redis.Redis()` and attached to the `Redis` instance. When calling `Redis.aclose` this internal connection pool closes automatically, which disconnects all connections."
1919
]
2020
},
2121
{
@@ -48,7 +48,7 @@
4848
"cell_type": "markdown",
4949
"metadata": {},
5050
"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."
51+
"If you create a custom `ConnectionPool` to be used by a single `Redis` instance, use the `Redis.from_pool` class method. The Redis client will take ownership of the connection pool. 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."
5252
]
5353
},
5454
{
@@ -61,7 +61,7 @@
6161
"\n",
6262
"pool = redis.ConnectionPool.from_url(\"redis://localhost\")\n",
6363
"client = redis.Redis.from_pool(pool)\n",
64-
"await client.close()"
64+
"await client.aclose()"
6565
]
6666
},
6767
{
@@ -74,7 +74,7 @@
7474
},
7575
"source": [
7676
"\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."
77+
"However, if the `ConnectionPool` is to be shared by several `Redis` instances, you should use the `connection_pool` argument, and you may want to disconnect the connection pool explicitly."
7878
]
7979
},
8080
{

0 commit comments

Comments
 (0)