Hi,

I am wondering what style people are using to define their grpc services. 
For example, a service def could be written something like this, in its 
most simple form:

syntax = "proto3";

package test;

message Ping {
  string theMessage = 1;
}

message Pong {
  string theResponse = 1;
}

service MyService {
  rpc SaySomething (Ping) returns (Pong);
}

Or, I have also seen this style where the payloads are encapsulated in 
separate request and response objects (more like how you would do it in 
schema perhaps)

syntax = "proto3";

package test;

message Ping {
  string theMessage = 1;
}

message PingRequest {
  Ping request = 1;
}

message Pong {
  string theResponse = 1;
}

message PongResponse {
  Pong response = 1;
}

service MyService {
  rpc SaySomething (PingRequest) returns (PongResponse);
}

I find that - at least in java - this definition generates a slightly 
easier to discover code syntax from the ide, but is it worthwhile to 
introduce the indirection and extra payload bytes just for this?

Would be nice to hear from long-time grpc users which style they prefer and 
why :-)

Thanks,
Jorg

-- 
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/160c4699-2771-482a-b242-27609cca8205%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to