You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should be possible using a closeable iterator: lift the generator in the __iter__ method of an object (can just convert event_stream to a class) and add a close method, which will be called on connection close.
However, this may only happen when a write to the socket fails, so there probably needs to be a "heartbeat" regularly sending something irrelevant (e.g. a line of comment) in order to trigger the failure, and thus the closing of the iterator.
As far as I can see, for the current redis-based implementation this would require a timeout on pubsub.listen(), which I don't believe exists.
It seems that the redis connection keeped when the page is closed. How to handle client closed event ?
The text was updated successfully, but these errors were encountered: