trio-websocket
trio-websocket copied to clipboard
WebSocket client and server implementation for Python Trio
> It will block until the server is accepting connections and then return a :class:`WebSocketServer` object > :returns: This method never returns unless cancelled. These cannot both be true. The...
Error handling is a little tricky in Trio... After #132 we should probably add some documentation that shows common error handling scenarios. Here's an example of something I messed up:...
Several of the APIs in this library create a "hidden" nursery that runs the connection's background task. This has the surprising side effect that something that looks like single-task code...
i.e. enum with code as value, and a reason attribute I'd like to be able to compare close reason without resorting to string comparison
Would be great to have an example of upgrading a connection from http, based on the trio-server example in h11.
There are a lot of complex code paths for closing a websocket connection, mostly because the first implementation was overly simplistic and I kept hacking away on it to handle...
Right now the `WebSocketConnection` will buffer partial messages until the entire message is received. There should be some option (probably in the constructor) to allow receiving partial messages instead.
_Preface: I don't know if this issue will be resolved by writing code, writing docs, or both. I'm starting this thread just to document some of the issues around backpressure...
e.g. coverage tool reports regression on unrelated change: https://coveralls.io/builds/20028763/source?filename=trio_websocket%2F_impl.py#L842 it's the `except` clause in `_write_pending` if there are timing issues in the tests, that could explain intermittent errors like #68
This tests fails intermittently. It might have some race condition. I haven't noticed this behavior on Linux yet. ``` ================================================= test session starts ================================================== platform darwin -- Python 3.7.0, pytest-3.8.2,...