Skip to content

Commit 7ed1ff7

Browse files
committed
documentation update
1 parent a52ea5f commit 7ed1ff7

File tree

7 files changed

+66
-7
lines changed

7 files changed

+66
-7
lines changed

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171

7272
autodoc_default_flags = ['members']
7373
autosummary_generate = True
74+
autodoc_inherit_docstrings = False
7475
autodoc_typehints = 'description'
7576
autodoc_typehints_format = 'short'
7677
autodoc_member_order = 'bysource'

docs/extensions.rst

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,38 @@
11
Extensions
22
==========
33

4-
.. autosummary::
5-
:toctree: generated
4+
Transports
5+
----------
66

7-
.. automodule:: rsocket
8-
:noindex:
7+
TCP
8+
~~~
99

10+
.. automodule:: rsocket.transports.tcp
11+
:members:
12+
13+
Websocket
14+
~~~~~~~~~
15+
16+
aiohttp
17+
+++++++
18+
19+
.. automodule:: rsocket.transports.aiohttp_websocket
20+
:members:
21+
22+
quart
23+
+++++
24+
25+
.. automodule:: rsocket.transports.quart_websocket
26+
:members:
27+
28+
quic
29+
~~~~
30+
31+
.. automodule:: rsocket.transports.aioquic_transport
32+
:members:
33+
34+
http3
35+
~~~~~
36+
37+
.. automodule:: rsocket.transports.http3_transport
38+
:members:

rsocket/transports/aiohttp_websocket.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
async def websocket_client(url: Optional[str] = None,
1919
websocket: Optional[ClientWebSocketResponse] = None,
2020
**kwargs) -> RSocketClient:
21+
"""
22+
Helper method to instantiate an RSocket client using a websocket url over aiohttp client.
23+
"""
24+
2125
async with RSocketClient(single_transport_provider(TransportAioHttpClient(url, websocket)),
2226
**kwargs) as client:
2327
yield client
@@ -40,6 +44,9 @@ async def websocket_handler(request):
4044

4145

4246
class TransportAioHttpClient(AbstractMessagingTransport):
47+
"""
48+
RSocket transport over client side aiohttp websocket.
49+
"""
4350

4451
def __init__(self, url: Optional[str] = None, websocket: Optional[ClientWebSocketResponse] = None):
4552
super().__init__()

rsocket/transports/aioquic_transport.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ def quic_event_received(self, event: QuicEvent) -> None:
8080

8181

8282
class RSocketQuicTransport(AbstractMessagingTransport):
83+
"""
84+
RSocket transport over server/client side quic connection.
85+
"""
86+
8387
def __init__(self, quic_protocol: RSocketQuicProtocol):
8488
super().__init__()
8589
self._quic_protocol = quic_protocol

rsocket/transports/http3_transport.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ async def receive_bytes(self) -> bytes:
4343
return await self.queue.get()
4444

4545
async def close(self, code: int = 1000, reason: str = "") -> None:
46-
"""
47-
Perform the closing handshake.
48-
"""
4946
data = self.websocket.send(
5047
wsproto.events.CloseConnection(code=code, reason=reason)
5148
)
@@ -80,6 +77,10 @@ def __init__(self, url: str) -> None:
8077

8178

8279
class RSocketHttp3ClientProtocol(QuicConnectionProtocol):
80+
"""
81+
RSocket transport over client side http3 connection.
82+
"""
83+
8384
def __init__(self, *args, **kwargs):
8485
super().__init__(*args, **kwargs)
8586
self.pushes: Dict[int, Deque[H3Event]] = {}
@@ -149,6 +150,9 @@ def quic_event_received(self, event: QuicEvent) -> None:
149150

150151

151152
class Http3TransportWebsocket(AbstractMessagingTransport):
153+
"""
154+
RSocket transport over server side http3 connection.
155+
"""
152156

153157
def __init__(self, websocket: Union[WebSocket, ClientWebSocket]):
154158
super().__init__()

rsocket/transports/quart_websocket.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111

1212
async def websocket_handler(on_server_create=None, **kwargs):
13+
"""
14+
Helper method to instantiate an RSocket server using a quart websocket connection.
15+
"""
16+
1317
transport = TransportQuartWebsocket()
1418
server = RSocketServer(transport, **kwargs)
1519

@@ -20,6 +24,9 @@ async def websocket_handler(on_server_create=None, **kwargs):
2024

2125

2226
class TransportQuartWebsocket(AbstractMessagingTransport):
27+
"""
28+
RSocket transport over server side quart websocket.
29+
"""
2330

2431
async def handle_incoming_ws_messages(self):
2532
try:

rsocket/transports/tcp.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77

88
class TransportTCP(Transport):
9+
"""
10+
RSocket transport over asyncio TCP connection.
11+
12+
:param reader: asyncio connection reader stream
13+
:param writer: asyncio connection writer stream
14+
"""
15+
916
def __init__(self, reader: StreamReader, writer: StreamWriter):
1017
super().__init__()
1118
self._writer = writer

0 commit comments

Comments
 (0)