Skip to content

Commit 0e0e277

Browse files
committed
changelog update. allow different names for composite metadata routed method argument. add Payload class to documentation
1 parent de7b9c3 commit 0e0e277

File tree

5 files changed

+33
-14
lines changed

5 files changed

+33
-14
lines changed

CHANGELOG.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ v0.4.6
55
======
66
- fire_and_forget now only removes the stream id when the future denoting the frame was sent, is done
77
- API documentation auto generated at rsocket.readthedocs.io
8-
- Raise error on empty or None route specified in request router
9-
- Added the following methods to RequestRouter to allow specifying handlers of unknown routes:
10-
- response_unknown
11-
- stream_unknown
12-
- channel_unknown
13-
- fire_and_forget_unknown
14-
- metadata_push_unknown
15-
- Officially support route aliases by using the decorator multiple times on the same method
16-
- Fix value mapping in request router. A parameter of any name (not just *payload*) specified on a routed method with a type-hint other than Payload will use the payload_mapper specified in the router instantiation to decode the value.
8+
- Request router changes:
9+
- Raise error on empty or None route specified in request router
10+
- Added the following methods to RequestRouter to allow specifying handlers of unknown routes:
11+
- response_unknown
12+
- stream_unknown
13+
- channel_unknown
14+
- fire_and_forget_unknown
15+
- metadata_push_unknown
16+
- Officially support route aliases by using the decorator multiple times on the same method
17+
- Fix value mapping in request router:
18+
-A parameter of any name (not just *payload*) specified on a routed method with a type-hint other than Payload will use the payload_mapper to decode the value
19+
- Any parameter with the type CompositeMetadata will receive the composite metadata
1720

1821
v0.4.5
1922
======

docs/api.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
11
Core API Reference
22
==================
33

4+
Controls
5+
--------
6+
47
Server
5-
------
8+
~~~~~~
69

710
.. automodule:: rsocket.rsocket_server
811
:members:
912
:inherited-members:
1013

1114
Client
12-
------
15+
~~~~~~
1316

1417
.. automodule:: rsocket.rsocket_client
1518
:members:
1619
:inherited-members:
1720

1821
Handler
19-
-------
22+
~~~~~~~
2023

2124
.. automodule:: rsocket.request_handler
2225
:members:
2326

2427

28+
Models
29+
------
30+
31+
.. automodule:: rsocket.payload
32+
:members:
33+
34+
2535
Interfaces
2636
----------
2737

docs/quickstart.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ Quick start
44
.. autosummary::
55
:toctree: generated
66

7-
87
A quick getting started guide is available at https://rsocket.io/guides/rsocket-py/simple

rsocket/payload.py

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

66

77
class Payload:
8+
"""
9+
A stream message (upstream or downstream). Contains data and metadata, boty `bytes`.
10+
11+
:param data: data segment of payload
12+
:param metadata: metadata segment of payload
13+
"""
14+
815
__slots__ = ('data', 'metadata')
916

1017
@staticmethod

rsocket/routing/request_router.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def _collect_route_arguments(self, route_processor, payload, composite_metadata)
151151
for parameter in route_signature.parameters:
152152
parameter_type = route_signature.parameters[parameter]
153153

154-
if 'composite_metadata' == parameter:
154+
if 'composite_metadata' == parameter or parameter_type is CompositeMetadata:
155155
route_kwargs['composite_metadata'] = composite_metadata
156156
else:
157157
if parameter_type.annotation not in (Payload, parameter_type.empty):

0 commit comments

Comments
 (0)