forked from aiortc/aioquic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more references to
QuicConnection.datagrams_to_send
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.
- Loading branch information
Showing
4 changed files
with
63 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from docutils import nodes | ||
from docutils.parsers.rst import Directive | ||
from docutils.statemachine import StringList | ||
|
||
|
||
class AioquicTransmit(Directive): | ||
def run(self): | ||
content = StringList( | ||
[ | ||
".. note::", | ||
" After calling this method you need to call the QUIC connection " | ||
":meth:`~aioquic.quic.connection.QuicConnection.datagrams_to_send` " | ||
"method to retrieve data which needs to be sent over the network. " | ||
"If you are using the :doc:`asyncio API <asyncio>`, calling the " | ||
":meth:`~aioquic.asyncio.QuicConnectionProtocol.transmit` method " | ||
"will do it for you.", | ||
] | ||
) | ||
node = nodes.paragraph() | ||
self.state.nested_parse(content, 0, node) | ||
return [node] | ||
|
||
|
||
def setup(app): | ||
app.add_directive("aioquic_transmit", AioquicTransmit) | ||
|
||
return { | ||
"version": "0.1", | ||
"parallel_read_safe": True, | ||
"parallel_write_safe": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters