diff --git a/docs/examples/asyncio_examples.ipynb b/docs/examples/asyncio_examples.ipynb index de4f6fc985..5eab4db1f7 100644 --- a/docs/examples/asyncio_examples.ipynb +++ b/docs/examples/asyncio_examples.ipynb @@ -15,7 +15,7 @@ "\n", "## Connecting and Disconnecting\n", "\n", - "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." + "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." ] }, { @@ -39,9 +39,9 @@ "source": [ "import redis.asyncio as redis\n", "\n", - "connection = redis.Redis()\n", - "print(f\"Ping successful: {await connection.ping()}\")\n", - "await connection.aclose()" + "client = redis.Redis()\n", + "print(f\"Ping successful: {await client.ping()}\")\n", + "await client.aclose()" ] }, { @@ -60,8 +60,8 @@ "import redis.asyncio as redis\n", "\n", "pool = redis.ConnectionPool.from_url(\"redis://localhost\")\n", - "connection = redis.Redis.from_pool(pool)\n", - "await connection.close()" + "client = redis.Redis.from_pool(pool)\n", + "await client.close()" ] }, { @@ -91,11 +91,11 @@ "import redis.asyncio as redis\n", "\n", "pool = redis.ConnectionPool.from_url(\"redis://localhost\")\n", - "connection1 = redis.Redis(connection_pool=pool)\n", - "connection2 = redis.Redis(connection_pool=pool)\n", - "await connection1.aclose()\n", - "await connection2.aclose()\n", - "await pool.disconnect()" + "client1 = redis.Redis(connection_pool=pool)\n", + "client2 = redis.Redis(connection_pool=pool)\n", + "await client1.aclose()\n", + "await client2.aclose()\n", + "await pool.aclose()" ] }, { @@ -113,9 +113,9 @@ "source": [ "import redis.asyncio as redis\n", "\n", - "connection = redis.Redis(protocol=3)\n", - "await connection.aclose()\n", - "await connection.ping()" + "client = redis.Redis(protocol=3)\n", + "await client.aclose()\n", + "await client.ping()" ] }, {