File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ You can close the connection.
103
103
Here's an example that terminates cleanly when it receives SIGTERM on Unix:
104
104
105
105
.. literalinclude :: ../../example/faq/shutdown_client.py
106
- :emphasize-lines: 10-12
106
+ :emphasize-lines: 10-14
107
107
108
108
How do I disable TLS/SSL certificate verification?
109
109
--------------------------------------------------
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ async def client():
9
9
async with connect ("ws://localhost:8765" ) as websocket :
10
10
# Close the connection when receiving SIGTERM.
11
11
loop = asyncio .get_running_loop ()
12
- loop .add_signal_handler (signal .SIGTERM , loop .create_task , websocket .close ())
12
+ def close ():
13
+ return loop .create_task (websocket .close ())
14
+ loop .add_signal_handler (signal .SIGTERM , close )
13
15
14
16
# Process messages received on the connection.
15
17
async for message in websocket :
You can’t perform that action at this time.
0 commit comments