Skip to content

Commit

Permalink
ConnectionPool SSL example (#2605)
Browse files Browse the repository at this point in the history
  • Loading branch information
CrimsonGlory authored Mar 15, 2023
1 parent 3edd49b commit 6d1061f
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 6d1061f

Please sign in to comment.