Hello.

I need to get a list of messages from server to client.
I see two possible ways to implement this:
1.
  - define the message
  - define a service with a function which returns a stream of the message

2.  
  - define the message
  - define a second message with a repeated field of the first message
  - define a service with a function which returns the second message

Here is an example:

syntax = "proto3";

import "google/protobuf/empty.proto";

message Dummy {
  string foo = 1;
  string bar = 2;
}

message DummyList {
  repeated Dummy dummy = 1;
}

service DummyService {
  rpc getDummyListWithStream(google.protobuf.Empty) returns (stream Dummy) 
{}
  rpc getDummyListWithRepeated(google.protobuf.Empty) returns (DummyList) {}
}


What is the most efficient way to implement this? getDummyListWithStream or 
getDummyListWithRepeated?
Note: client and server are both written in C++.

Thanks.

Julien

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/b8e554c0-c1c3-4877-b1ad-082e1945ad83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to