Skip to content

Latest commit

 

History

History
 
 

eventstream_rpc

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Eventstream RPC

This module implements client for eventstream RPC. The eventstream RPC client provides a base for defining custom RPC operations and implements interaction with RPC server.

Client Connection

ClientConnection class represents the connection to the RPC server. It's responsible for connection lifetime and can send connection-level messages (e.g. sending PING or opening a new stream).

Client Stream/Continuation

Application-level messages are supposed to be sent over streams. ClientConnection::NewStream creates a new stream which is represented by the ClientContinuation class.
The new stream must be activated with ClientContinuation::Activate method. This method initiates sending messages over the wire.

Application-level messages can be sent using ClientContinuation::SendMessage method.

Client Operation

Based upon a client continuation, this entity represents an abstract operation that the client can perform. Concrete operations should be implemented as classes inherited from the ClientOperation class.

Each operation has input data (referred as Request) and output data (referred as Response).
Requests are sent by the Activate method.

Example of a Client Operation

DeleteThingShadowOperation defines an RPC operation for deleting a thing shadow.

DeleteThingShadowOperation::Activate takes DeleteThingShadowRequest instance as an argument and sends it to the server.

After the request is done, you can use DeleteThingShadowOperation::GetResult to get an instance of the DeleteThingShadowResult class, an auxiliary wrapper class returning a response in case of success or an error in case of failure. To obtain an actual response, use DeleteThingShadowResult::GetOperationResponse method.