Skip to content
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

Improve documentation for QuicConnectionProtocol.transmit() #454

Merged
merged 3 commits into from
Jan 15, 2024

Conversation

jlaine
Copy link
Contributor

@jlaine jlaine commented Jan 14, 2024

No description provided.

Document the fact the `transmit()` method needs to be called when
sending data via the underlying `QuicConnection`.
Copy link

codecov bot commented Jan 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e899593) 100.00% compared to head (3a95812) 100.00%.

❗ Current head 3a95812 differs from pull request most recent head 66b38ea. Consider uploading reports for the commit 66b38ea to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #454   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines         4881      4881           
=========================================
  Hits          4881      4881           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jlaine
Copy link
Contributor Author

jlaine commented Jan 14, 2024

@ravenblackx This one is for you

Copy link

@ravenblackx ravenblackx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an improvement, but it would be nice to cross-reference transmit from the functions that are likely to make calling it necessary (send_data, send_headers, maybe the datagram one). As someone trying to use the library, I didn't even notice that transmit existed, so I wouldn't have seen documentation telling me to call it even with this update. It's surprising when a function named send does not actually send, so making that clear in the docs would be helpful. :)

@jlaine
Copy link
Contributor Author

jlaine commented Jan 15, 2024

Hm, in that case it's going to mean taking a different approach. Currently, (nearly) all the methods that queue data mention you should call the QuicConnection.datagrams_to_send method. This is exactly what transmit() does for you if you use the asyncio layer.

I am not comfortable sprinkling references to the asyncio layer all over the place as you can absolutely use quic and h3 and NOT use asyncio.

Instead of tediously copying the same text over and over, add a
`aioquic_transmit` Sphinx extension to mark methods for which
`datagrams_to_send` needs to be called.
@jlaine jlaine force-pushed the aioquic-transmit-docs branch from 66b38ea to de1c0f0 Compare January 15, 2024 11:04
@jlaine jlaine merged commit 3cdecdd into aiortc:main Jan 15, 2024
26 checks passed
@jlaine jlaine deleted the aioquic-transmit-docs branch January 15, 2024 11:07
@jlaine
Copy link
Contributor Author

jlaine commented Jan 15, 2024

@ravenblackx
Copy link

Yep, that's a lot more helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants