Skip to content

Commit 309b52b

Browse files
Request Channel Payloads from Requester (rsocket#154)
* Request Channel Payloads from Requester Clarifying that a channel sends PAYLOAD frames. - Depends on rsocket/rsocket#153 and will need rebasing. - Need to also change wording later in the document explaining interaction model. - Not certain about wording yet. * Update Protocol.md * Update Protocol.md * Update Protocol.md * Update Protocol.md
1 parent cb1182c commit 309b52b

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

Protocol.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ connection on reception of a frame that it does not understand with this bit not
145145

146146
#### Frame Validation
147147

148-
ReactiveSocket implementations may provide their own validation at the metadata level for specific frames. However, this is an application concern
149-
and not necessary for protocol processing.
148+
ReactiveSocket implementations may provide their own validation at the metadata level for specific frames. However, this is an application concern and not necessary for protocol processing.
150149

151150
#### Metadata Optional Header
152151

@@ -461,9 +460,7 @@ Frame Contents
461460
* __Initial Request N__: 32-bit signed integer representing the initial request N value for the stream. Only positive values are allowed.
462461
* __Request Data__: identification of the service being requested along with parameters for the request.
463462

464-
Please note that this explicitly does NOT follow rule number 17 in https://github.com/reactive-streams/reactive-streams-jvm/blob/v1.0.0/README.md#3-subscription-code
465-
466-
While ReactiveStreams supports a demand of up to 2^63-1, and treats 2^63-1 as a magic number signaling to not track demand, this is not the case for ReactiveSocket. ReactiveSocket prioritizes byte size and only uses 4 bytes instead of 8 so the magic number is unavailable.
463+
See Flow Control: Reactive Stream Semantics for more information on RequestN behavior.
467464

468465
### Request Channel Frame
469466

@@ -475,9 +472,9 @@ Frame Contents
475472
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
476473
| Stream ID |
477474
+-----------+-+-+-+-+-+---------+-------------------------------+
478-
|Frame Type |0|M|F|C|N| Flags |
475+
|Frame Type |0|M|F|C| Flags |
479476
+-------------------------------+-------------------------------+
480-
| Initial Request N (only if N bit set) |
477+
| Initial Request N |
481478
+---------------------------------------------------------------+
482479
Metadata & Request Data
483480
```
@@ -486,11 +483,14 @@ Frame Contents
486483
* (__M__)etadata: Metadata present
487484
* (__F__)ollows: More Fragments Follow This Fragment.
488485
* (__C__)omplete: bit to indicate COMPLETE.
489-
* (__N__): Is Initial Request N present or not
490486
* __Initial Request N__: 32-bit signed integer representing the initial request N value for channel. Only positive values are allowed.
491487
* __Request Data__: identification of the service being requested along with parameters for the request.
492488

493-
See Request Stream Frame for additional information.
489+
A requester MUST send only __one__ REQUEST_CHANNEL frame. Subsequent messages from requester to responder MUST be sent as PAYLOAD frames.
490+
491+
A requester MUST __not__ send PAYLOAD frames after the REQUEST_CHANNEL frame until the responder sends a REQUEST_N frame granting credits for number of PAYLOADs able to be sent.
492+
493+
See Flow Control: Reactive Stream Semantics for more information on RequestN behavior.
494494

495495
### Request N Frame
496496

@@ -512,7 +512,7 @@ Frame Contents
512512
* (__M__)etadata: Metadata __NOT__ present
513513
* __Request N__: 32-bit signed integer value of items to request. Only positive values are allowed.
514514

515-
See Request Stream Frame for additional information.
515+
See Flow Control: Reactive Stream Semantics for more information on RequestN behavior.
516516

517517
### Cancel Frame
518518

@@ -829,6 +829,10 @@ There are multiple flow control mechanics provided by the protocol.
829829

830830
[Reactive Stream](http://www.reactive-streams.org/) semantics for flow control of Streams, Subscriptions, and Channels.
831831

832+
Please note that this explicitly does NOT follow rule number 17 in https://github.com/reactive-streams/reactive-streams-jvm/blob/v1.0.0/README.md#3-subscription-code
833+
834+
While ReactiveStreams supports a demand of up to 2^63-1, and treats 2^63-1 as a magic number signaling to not track demand, this is not the case for ReactiveSocket. ReactiveSocket prioritizes byte size and only uses 4 bytes instead of 8 so the magic number is unavailable.
835+
832836
The Requester and the Responder MUST respect the reactive-streams semantics.
833837

834838
e.g. here's an example of a successful stream call with flow-control.

0 commit comments

Comments
 (0)