Hi all,
Greetings from me! I am a newbie of using gPRC, and my service is so
simple:
service KeyDB {
rpc Init(InitRequest) returns (InitResponse) {}
}
enum ServerResponse {
SUCCESS = 0;
ALREADY_EXISTS = 1;
}
message InitRequest {
bytes pub_key = 1;
}
message InitResponse {
ServerResponse response = 1;
}
The client just sends pub_key, and servers responses SUCCESS or key
ALREADY_EXISTS.
I find the ServerResponse code is very similar as grpc::StatusCode. So my
Server::Init
function always returns OK, and uses response to carry error code.
grpc::Status Server::Init(grpc::ServerContext* context, request, response)
{
......
response.set_response(ALREADY_EXISTS);
......
return grpc::Status()
}
So is there any canonical way of processing when grpc::StatusCode are
partly or all overlapped
with service's response? Or are there any better solutions?
Thanks very much in advance!
Best Regards
Nan Xiao
--
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/f2a5a660-b197-43ce-ac95-0926931b7cd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.