I am currently playing around with protocol buffers and now was
looking closer at the rpc code that can be generated by it.
But I am a bit confused. I did not find a way how to create rpc
messages that do not define a reply.
is there a way to create one-way rpc calls in protocol buffers?
An example what i would like would be that:
service myService
{
rpc Echo (EchoParam) returns (EchoReply) ;
rpc OneWayWithoutResponse(ParamsToSend);
}
the only workaround that i can think of would be creating a "Void"
message that is declared as the answer and the rpc implementation to
then "ignore" those.
like this:
message Void
{
}
service myService
{
rpc OneWayWithoutResponse(FirmwareEvent) returns (Void);
}
is there a way how i can avoid this workaround?
cheers phelyks
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
Nope, that's the way it's done. Generally speaking, it's recommended
that you create a separate empty response message for each service
method instead of a generic Void message you return from many methods,
so that if you ever do decide to send a response back you don't have
to switch message types, but otherwise that's the usual way it's done.
- Adam