Skip to content

Commit 09076bc

Browse files
committed
Update docs
1 parent b55d266 commit 09076bc

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

docs/examples/asyncio_examples.ipynb

+14-14
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.close` which disconnects all connections."
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."
1919
]
2020
},
2121
{
@@ -39,9 +39,9 @@
3939
"source": [
4040
"import redis.asyncio as redis\n",
4141
"\n",
42-
"connection = redis.Redis()\n",
43-
"print(f\"Ping successful: {await connection.ping()}\")\n",
44-
"await connection.aclose()"
42+
"client = redis.Redis()\n",
43+
"print(f\"Ping successful: {await client.ping()}\")\n",
44+
"await client.aclose()"
4545
]
4646
},
4747
{
@@ -60,8 +60,8 @@
6060
"import redis.asyncio as redis\n",
6161
"\n",
6262
"pool = redis.ConnectionPool.from_url(\"redis://localhost\")\n",
63-
"connection = redis.Redis.from_pool(pool)\n",
64-
"await connection.close()"
63+
"client = redis.Redis.from_pool(pool)\n",
64+
"await client.close()"
6565
]
6666
},
6767
{
@@ -91,11 +91,11 @@
9191
"import redis.asyncio as redis\n",
9292
"\n",
9393
"pool = redis.ConnectionPool.from_url(\"redis://localhost\")\n",
94-
"connection1 = redis.Redis(connection_pool=pool)\n",
95-
"connection2 = redis.Redis(connection_pool=pool)\n",
96-
"await connection1.aclose()\n",
97-
"await connection2.aclose()\n",
98-
"await pool.disconnect()"
94+
"client1 = redis.Redis(connection_pool=pool)\n",
95+
"client2 = redis.Redis(connection_pool=pool)\n",
96+
"await client1.aclose()\n",
97+
"await client2.aclose()\n",
98+
"await pool.aclose()"
9999
]
100100
},
101101
{
@@ -113,9 +113,9 @@
113113
"source": [
114114
"import redis.asyncio as redis\n",
115115
"\n",
116-
"connection = redis.Redis(protocol=3)\n",
117-
"await connection.aclose()\n",
118-
"await connection.ping()"
116+
"client = redis.Redis(protocol=3)\n",
117+
"await client.aclose()\n",
118+
"await client.ping()"
119119
]
120120
},
121121
{

0 commit comments

Comments
 (0)