-
-
Notifications
You must be signed in to change notification settings - Fork 946
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
docs(ws-tutorial): add a WebSocket tutorial #2245
Conversation
Add a tutorial on how to work with websockets in a Falcon app. This is to be read as a quickstart, linking to the reference page for more info. falconry#2240
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only skimmed through quickly, and it looks really nice! Thank you!
As discussed in the Sprint room,
- It would be nice to put at least the final version into a
.py
file, so we could run linters on it, or maybe even write a couple of simple CI test cases. - Passing any headers to a WebSocket connection unfortunately didn't seem to work the last time I checked. We need to check if that has changed, and then maybe offer a different way, because I think people do want to experiment with this in the browser. Maybe it would be also nice to provide a short Javascript Console snippet to connect to our server, and log messages.
Include the final code instead of hard-coding it in the docs. falconry#2240
…_websocket_tutorial
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2245 +/- ##
============================================
- Coverage 100.00% 36.17% -63.83%
============================================
Files 63 63
Lines 6852 6852
Branches 1260 1260
============================================
- Hits 6852 2479 -4373
- Misses 0 4315 +4315
- Partials 0 58 +58 ☔ View full report in Codecov by Sentry. |
The max width is now set to 80. Not all lines fit, but most do. falconry#2240
Authentication is now done via the first-message method instead of headers. falconry#2240
Typo fix. falconry#2240
Do not generate coverage for the run command as that's only used when locally running the code. falconry#2240
Add an explanation why the code isn't tested. falconry#2240
Add tests for the example code. falconry#2240
…_websocket_tutorial
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you once again for joining our Sprint, and for this tutorial! 💯
I took the liberty of tweaking some small things to my liking, and I think we can now merge this. I'll file follow-up improvements as new issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it seems we forgot to commit wslook/.coveragerc
. Do you maybe have the file lying anywhere around @derkweijers?
Yes! Added it to the repo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍
|
||
Now we can test the application by running the following command:: | ||
|
||
$ http localhost:8000/hello |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could mention how to install httpie
I guess I've arrived too late with the review, @vytas7 you mentioned you wanted to cleanup something else, maybe you can incorporate the suggestions? @derkweijers thanks for the great tutorial, and for participating in the sprint! |
Summary of Changes
Add a tutorial on how to work with websockets in a Falcon app. This is to be read as a quickstart, linking to the reference page for more info.
Related Issues
Closes #2240
Pull Request Checklist
This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!
If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.
docs/
.docs/
.versionadded
,versionchanged
, ordeprecated
directives.docs/_newsfragments/
, with the file name format{issue_number}.{fragment_type}.rst
. (Runtowncrier --draft
to ensure it renders correctly.)If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!
PR template inspired by the attrs project.