-
-
Notifications
You must be signed in to change notification settings - Fork 540
Threading server should close connections on exit #1488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This would also be more elegant than f9cea9c. |
Implementing this may hit #1596. |
Hi, I just ran some tests to try to understand how the (sync) connections are handled in WebSockets (I described one in #1596). So, what about the server side? I noticed that a server process with active connections also has some issues when exiting. I think graceful server shutdowns/restarts can be handled within the library. I have an idea on how to fix it. Would it be okay to work on it? Proposed approachWe can store a set of initiated threads/connections in the With this fix, it would be easier for users to implement graceful shutdowns/service restarts. Of course, threads can still be blocked in the handler functions, but that'd be a different issue. What do you think? |
* Implement sync server connection tracking. * Add ServerConnection.close() call for exising connections on server shutdown. This is useful for cleanly terminating/restarting the server process. Issue python-websockets#1488
Essentially, it should behave like the asyncio server. It could also gain the connections attribute.
The text was updated successfully, but these errors were encountered: