-
Notifications
You must be signed in to change notification settings - Fork 40
Documentation remarks #118
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
The docs for
This reads to me that the close frame still needs to be sent using the network layer used by the user. However, with the code below, which is straight from the synchronous_server.py example I get an exception from the
So in this case, given that the connection appears to be already closed is there a need to send the response? And how to detect that situation? |
Another thing to put in the docs: I couldn't figure out why there's receive events for both text and binary messages, but sending only has a single |
Hi @paulmelis could you open a pull request with these fixes in? I'd be happy to review and merge.
To detect this I check that |
I am going to work on updating https://github.com/HyperionGray/trio-websocket to wsproto=0.14.0, and while I do that I will update the docs as I go and submit a PR when I'm finished. |
@paulmelis I am incorporating your feedback.
Yes, the synchronous example is very awkward in this aspect. Almost all wsproto consumers will want to use |
Flesh out some missing pydocs, clean up the introduction, and make the examples more common wsproto idioms.
@mehaase @paulmelis I think this issue can be now closed, since we merged #119, right? |
Looks good to me |
One more request for @pgjones or @Kriechi: The ReadTheDocs build hasn't run in about 4 months, I think because it is configured as a "GitHub service" and those are deprecated and don't run anymore. We should delete the RTD service and add a webhook instead[1]. I would offer to do this myself but I don't have admin rights to the RTD project. [1] We also have a Travis CI service, and if I understand the deprecation process correctly, this has also superseded by webhooks and can be removed. |
Thanks for pointing this out! |
Hi, just started trying out wsproto (nice concept) and I find the available documentation to be a bit suboptimal:
The docs at https://wsproto.readthedocs.io/en/latest/basic-usage.html seem pretty out of date. E.g. under "Connecting to a WebSocket server" the event handling uses
TextReceived
andBinaryReceived
, but those are now namedTextMessage
andBytesMessage
?I built the docs locally (
make html
), butWSConnection
shows no member information.Connection
does have more interesting stuff documented, but that isn't listed in the generated docs (nor is it the end-user class to use).As
WSConnection.events
isn't document I looked atwsproto/example/synchronous_server.py
Line 76 in a7abcc5
WSConnection.events()
raisesStopIteration
when the client disconnects unexpectedly. That can't be right in the general case? That comment seems misleading and is probably only valid for that specific example.Edit: ah, https://github.com/python-hyper/wsproto/blob/master/example/synchronous_client.py gives more clues:
Under Getting Started -> Connections (in my local doc build) it says (emphasis mine)
That should read "returns zero bytes"
The text was updated successfully, but these errors were encountered: