Skip to content

Commit 22d3efa

Browse files
benjchristensenNiteshKant
authored andcommitted
Rename RESPONSE to PAYLOAD
Rename RESPONSE to PAYLOAD since it flows both directions, not just in response to a request. Preparative change for making requestChannel send messages with PAYLOAD, not multiple REQUEST_CHANNEL frames.
1 parent 7826cca commit 22d3efa

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

Protocol.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ to odd/even values. In other words, a client MUST generate odd Stream IDs and a
198198
| __REQUEST_CHANNEL__ | 0x07 | __Request Channel__: Request a completable stream in both directions. |
199199
| __REQUEST_N__ | 0x08 | __Request N__: Request N more items with ReactiveStreams semantics. |
200200
| __CANCEL__ | 0x09 | __Cancel Request__: Cancel outstanding request. |
201-
| __RESPONSE__ | 0x0A | __Response__: Response to a request. |
201+
| __PAYLOAD__ | 0x0A | __Payload__: Payload on a stream. For example, response to a request, or message on a channel. |
202202
| __ERROR__ | 0x0B | __Error__: Error at connection or application level. |
203203
| __METADATA_PUSH__ | 0x0C | __Metadata__: Asynchronous Metadata frame |
204204
| __RESUME__ | 0x0D | __Resume__: Replaces SETUP for Resuming Operation (optional) |
@@ -649,7 +649,7 @@ A client assumes a SETUP is rejected if it receives a SETUP_ERROR.
649649

650650
Until connection establishment is complete, a Requester MUST NOT send any Request frames.
651651

652-
Until connection establishment is complete, a Responder MUST NOT emit any RESPONSE frames.
652+
Until connection establishment is complete, a Responder MUST NOT emit any PAYLOAD frames.
653653

654654
### Negotiation
655655

@@ -695,7 +695,7 @@ The possible sequences with LEASE are below.
695695

696696
## Fragmentation And Reassembly
697697

698-
RESPONSE frames and all REQUEST frames may represent a large object and MAY need to be fragmented to fit within the Frame Data size. When this
698+
PAYLOAD frames and all REQUEST frames may represent a large object and MAY need to be fragmented to fit within the Frame Data size. When this
699699
occurs, the __F__ flag indicates if more fragments follow the current frame (or not).
700700

701701
## Stream Sequences and Lifetimes
@@ -715,7 +715,7 @@ time, but it is recommended that an implementation not aggressively re-use IDs.
715715
### Request Response
716716

717717
1. RQ -> RS: REQUEST_RESPONSE
718-
1. RS -> RQ: RESPONSE with COMPLETE
718+
1. RS -> RQ: PAYLOAD with COMPLETE
719719

720720
or
721721

@@ -748,19 +748,19 @@ REQUEST_FNF are assumed to be best effort and MAY not be processed due to: (1) S
748748
### Request Stream
749749

750750
1. RQ -> RS: REQUEST_STREAM
751-
1. RS -> RQ: RESPONSE*
751+
1. RS -> RQ: PAYLOAD*
752752
1. RS -> RQ: ERROR
753753

754754
or
755755

756756
1. RQ -> RS: REQUEST_STREAM
757-
1. RS -> RQ: RESPONSE*
758-
1. RS -> RQ: RESPONSE with COMPLETE
757+
1. RS -> RQ: PAYLOAD*
758+
1. RS -> RQ: COMPLETE
759759

760760
or
761761

762762
1. RQ -> RS: REQUEST_STREAM
763-
1. RS -> RQ: RESPONSE*
763+
1. RS -> RQ: PAYLOAD*
764764
1. RQ -> RS: CANCEL
765765

766766
At any time, a client may send REQUEST_N frames.
@@ -776,13 +776,13 @@ Upon sending a COMPLETE or ERROR, the stream is terminated on the Responder.
776776
### Request Channel
777777

778778
1. RQ -> RS: REQUEST_CHANNEL* intermixed with
779-
1. RS -> RQ: RESPONSE*
779+
1. RS -> RQ: PAYLOAD*
780780
1. RS -> RQ: COMPLETE | ERROR
781781

782782
or
783783

784784
1. RQ -> RS: REQUEST_CHANNEL* intermixed with
785-
1. RS -> RQ: RESPONSE*
785+
1. RS -> RQ: PAYLOAD*
786786
1. RQ -> RS: CANCEL
787787

788788
At any time, a Requester may send REQUEST_CHANNEL frames with F bit set to indicate fragmentation.
@@ -815,7 +815,7 @@ Upon sending a COMPLETE or ERROR, the stream is terminated on the Responder.
815815
#### Responder
816816

817817
1. CLOSED: implicit starting/ending state of all stream IDs
818-
1. Responding: sending RESPONSEs and processing REQUEST_N
818+
1. Responding: sending PAYLOADs and processing REQUEST_N
819819
1. CLOSED (received CANCEL)
820820
1. CLOSED (sent COMPLETE or received REQUEST_FNF)
821821
1. CLOSED (sent ERROR)
@@ -833,13 +833,13 @@ The Requester and the Responder MUST respect the reactive-streams semantics.
833833
e.g. here's an example of a successful stream call with flow-control.
834834

835835
1. RQ -> RS: REQUEST_STREAM (REQUEST_N=3)
836-
1. RS -> RQ: RESPONSE
837-
1. RS -> RQ: RESPONSE
838-
1. RS -> RQ: RESPONSE
836+
1. RS -> RQ: PAYLOAD
837+
1. RS -> RQ: PAYLOAD
838+
1. RS -> RQ: PAYLOAD
839839
1. RS needs to wait for a new REQUEST_N at that point
840840
1. RQ -> RS: REQUEST_N (n=3)
841-
1. RS -> RQ: RESPONSE
842-
1. RS -> RQ: RESPONSE with COMPLETE
841+
1. RS -> RQ: PAYLOAD
842+
1. RS -> RQ: PAYLOAD with COMPLETE
843843

844844
#### Lease Semantics
845845

@@ -869,16 +869,16 @@ under [Keepalive Frame](#keepalive-frame). The decision to close a connection du
869869
1. Request keepalive and timeout semantics are the responsibility of the application.
870870
1. Lack of REQUEST_N frames that stops a stream is an application concern and SHALL NOT be handled by the protocol.
871871
1. Lack of LEASE frames that stops new Requests is an application concern and SHALL NOT be handled by the protocol.
872-
1. If a RESPONSE for a REQUEST_RESPONSE is received that does not have a COMPLETE flag set, the implementation MUST
872+
1. If a PAYLOAD for a REQUEST_RESPONSE is received that does not have a COMPLETE flag set, the implementation MUST
873873
assume it is set and act accordingly.
874-
1. Reassembly of RESPONSEs and REQUEST_CHANNELs MUST assume the possibility of an infinite stream.
874+
1. Reassembly of PAYLOADs and REQUEST_CHANNELs MUST assume the possibility of an infinite stream.
875875
1. Stream ID values MAY be re-used after completion or error of a stream.
876-
1. A RESPONSE with both __F__ and __C__ flags set, implicitly ignores the __F__ flag.
876+
1. A PAYLOAD with both __F__ and __C__ flags set, implicitly ignores the __F__ flag.
877877
1. All other received frames that are not accounted for in previous sections MUST be ignored. Thus, for example:
878878
1. Receiving a Request frame on a Stream ID that is already in use MUST be ignored.
879879
1. Receiving a CANCEL on an unknown Stream ID (including 0) MUST be ignored.
880880
1. Receiving an ERROR on an unknown Stream ID MUST be ignored.
881-
1. Receiving a RESPONSE on an unknown Stream ID (including 0) MUST be ignored.
881+
1. Receiving a PAYLOAD on an unknown Stream ID (including 0) MUST be ignored.
882882
1. Receiving a METADATA_PUSH with a non-0 Stream ID MUST be ignored.
883883
1. A server MUST ignore a SETUP frame after it has accepted a previous SETUP.
884884
1. A server MUST ignore a SETUP_ERROR frame.
@@ -905,13 +905,13 @@ ReactiveSocket resumption exists only for specific cases. It is not intended to
905905

906906
Resuming operation requires knowing the position of data reception of the previous connection. For this to be simplified, the underlying transport is assumed to support contiguous delivery of data on a per frame basis. In other words, partial frames are not delivered for processing nor are gaps allowed in the stream of frames sent by either the client or server. The current list of supported transports (TCP, WebSocket, and Aeron) all satisfy this requirement or can be made to do so in the case of TCP.
907907

908-
As a Requester or Responder __sends__ REQUEST, CANCEL, or RESPONSE frames, it maintains a __position__ of that frame within the connection in that direction. This is a 64-bit value that starts at 0. As a Requester or Responder __receives__ REQUEST, CANCEL, or RESPONSE frames, it maintains an __implied position__ of that frame within the connection in that direction. This is also a 64-bit value that starts at 0.
908+
As a Requester or Responder __sends__ REQUEST, CANCEL, or PAYLOAD frames, it maintains a __position__ of that frame within the connection in that direction. This is a 64-bit value that starts at 0. As a Requester or Responder __receives__ REQUEST, CANCEL, or PAYLOAD frames, it maintains an __implied position__ of that frame within the connection in that direction. This is also a 64-bit value that starts at 0.
909909

910910
The reason this is “implied” is that the position is not included in each frame and is inferred simply by the message being sent/received on the connection in relation to previous frames.
911911

912912
This position will be used to identify the location for resuming operation to begin.
913913

914-
Frame types outside REQUEST, CANCEL, ERROR, and RESPONSE do not have assigned (nor implied) positions.
914+
Frame types outside REQUEST, CANCEL, ERROR, and PAYLOAD do not have assigned (nor implied) positions.
915915

916916
### Client Lifetime Management
917917

@@ -927,8 +927,8 @@ Client side resumption operation starts when the client desires to try to resume
927927
* Client waits for either a RESUME_OK or ERROR frame from the server.
928928
* On receiving an ERROR frame, the client MUST NOT attempt resumption again if the error code was REJECTED_RESUME.
929929
* On receiving a RESUME_OK, the client:
930-
* MUST assume that the next REQUEST, CANCEL, ERROR, and RESPONSE frames have an implied position commencing from the last implied positions
931-
* MAY retransmit *all* REQUEST, CANCEL, ERROR, and RESPONSE frames starting at the RESUME_OK Last Received Position field value from the server.
930+
* MUST assume that the next REQUEST, CANCEL, ERROR, and PAYLOAD frames have an implied position commencing from the last implied positions
931+
* MAY retransmit *all* REQUEST, CANCEL, ERROR, and PAYLOAD frames starting at the RESUME_OK Last Received Position field value from the server.
932932
* MAY send an ERROR frame indicating the end of the connection and MUST NOT attempt resumption again
933933

934934
Server side resumption operation starts when the client sends a RESUME frame. The operation then proceeds as the following:
@@ -937,8 +937,8 @@ Server side resumption operation starts when the client sends a RESUME frame. Th
937937
* MUST send an ERROR frame if the server does not support resuming operation. This is accomplished by handling the Ignore bit in the RESUME frame.
938938
* use the RESUME Identification Token field to determine which client the resume pertains to. If the client is identified successfully, resumption MAY be continued. If not identified, then the server MUST send an ERROR frame.
939939
* if successfully identified, then the server MAY send a RESUME_OK and then:
940-
* MUST assume that the next REQUEST, CANCEL, ERROR, and RESPONSE frames have an implied position commencing from the last implied positions
941-
* MAY retransmit *all* REQUEST, CANCEL, ERROR, and RESPONSE frames starting at the RESUME Last Received Position field value from the client.
940+
* MUST assume that the next REQUEST, CANCEL, ERROR, and PAYLOAD frames have an implied position commencing from the last implied positions
941+
* MAY retransmit *all* REQUEST, CANCEL, ERROR, and PAYLOAD frames starting at the RESUME Last Received Position field value from the client.
942942
* if successfully identified, then the server MAY send an ERROR frame if the server can not resume operation given the value of RESUME Last Received Position if the position is not one it deems valid to resume operation from or other extenuating circumstances.
943943

944944
A Server that receives a RESUME frame after a SETUP frame, SHOULD send an ERROR.

0 commit comments

Comments
 (0)