In standard JSON-Rx and Binary-Rx the request payload
is a static value and the response is an observable—a stream of values:
Reactive-RPC extension to JSON-Rx allows the request payload
to also be a stream of values:
This way Reactive-RPC dominates the JSON-Rx protocol, where JSON-Rx protocol is a special case of Reactive-RPC protocol when in all requests the payload data is static.
To be able to make the request payload
to be an observable Reactive-RPC removes the Subscribe Message of JSON-Rx and adds four new messages:
Subscribe Complete Message
Subscribe Data Message
Subscribe Error Message
Subscribe Un-subscribe Message
The above four messages describe the state transition of the request payload
observable reactive states.
Subsribe Complete Message is sent by the client to the server. The message notifies the server that the request payload
observable has completed.
If this message is sent as the first message in the RPC call message exchange, it starts a new response subscription and immediately completes the request observable. Effectively, it can emulate the Subscribe Message of JSON-Rx.
Subscribe Data Message is sent by the client to the server. The message contains a payload, which is data received as part of the request payload
.
Subscribe Error Message is sent by the client to the sever, when request payload
observable emits an error.
Subscribe Un-subscribe Message is sent by the server to the client, when server wants to un-subscribe from the request payload
observable.