Skip to content

Commit

Permalink
ConnectionPool SSL example (redis#2605)
Browse files Browse the repository at this point in the history
  • Loading branch information
CrimsonGlory authored and aksinha334 committed Mar 15, 2023
1 parent 7b09b3d commit c7f9457
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/examples/ssl_connection_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,27 @@
"url_connection.ping()"
]
},
{
"cell_type": "markdown",
"id": "04e70233",
"metadata": {},
"source": [
"## Connecting to a Redis instance using ConnectionPool"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2903de26",
"metadata": {},
"outputs": [],
"source": [
"import redis\n",
"redis_pool = redis.ConnectionPool(host=\"localhost\", port=6666, connection_class=redis.SSLConnection)\n",
"ssl_connection = redis.StrictRedis(connection_pool=redis_pool) \n",
"ssl_connection.ping()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit c7f9457

Please sign in to comment.