Listen to disconnects with @websocket_stream #4175
Closed
borisnieuwenhuis
started this conversation in
General
Replies: 1 comment
-
|
Nevermind, I managed to catch the disconnect by wrapping the generator with a try finally block. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I need to know when a user disconnects to do cleanup on the stream.
But I cannot find anyway to get notified when a client disconnects.
With a class Handler(WebsocketListener) it is very obvious and you get a callback, but I cannot find any way to get on_disconnect
notification when using the @websocket_stream decorator.
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions