...

/

Exercise: Concatenate Client Streaming RPC

Exercise: Concatenate Client Streaming RPC

Implement a client streaming RPC in the text editor system which returns a string in response to a stream of client requests.

Concatenate text RPC

In this exercise, your goal is to implement a concatenate RPC Client Streaming API in a TextEditorService.

  • The function takes a stream of Request messages where each message contains a string.

  • It returns a single Result message that represents the concatenated string of all inputs.

Follow these steps:

  1. Define the RPC in a .proto file: Define the RPC in the service definition in the proto file.

  2. Implement the Server code: Implement the server logic to handle the streaming requests and return the concatenated response.

  3. Test the server code by implementing the client: Ensure the client can send multiple strings and the server responds with the concatenated string.

The client will send a stream of strings, “hello”, “world”, “from”, and “gRPC!”, and the server will respond with a single string “hello world from gRPC! ”.

Good luck!


Step 1: Define the RPC in the .proto file

Update the service definition in text-editor.proto to include the concatenate ...