On Tue, Nov 15, 2016 at 5:17 PM, <[email protected]> wrote: > Yes, I agree with you that it is all dependent on the generated code. So > does protobuf compiler provide the option to generate async APIs? If not, > how complicated will it be to modify the complier? > Protobuf itself doesn't provide the RPC implementation. You can write a protoc plugin to generate RPC code just like how most protobuf-based RPC works: https://github.com/google/protobuf/blob/master/docs/third_party.md#rpc-implementations
> > On Tuesday, November 15, 2016 at 5:11:36 PM UTC-8, Feng Xiao wrote: > >> >> >> On Tue, Nov 15, 2016 at 4:37 PM, <[email protected]> wrote: >> >>> Thanks for the reply. I am not using gRPC. I want to use protobuf to >>> define RPC, but have a separate or customized transport implementation. >>> >> There is no such thing as sync vs. async API in proto definition. It's >> only relevant in the generated service API. For example, given: >> service HelloService { >> rpc Hello(Request) returns (Response); >> } >> >> You can generate code that provides sync API, or generate code that >> provides async API: >> class HelloService { >> public: >> void Hello(const Request& request, const std::function<void(const >> Response&)>& result_callback); >> } >> >> >>> >>> On Tuesday, November 15, 2016 at 4:30:12 PM UTC-8, Feng Xiao wrote: >>>> >>>> Are you using grpc? You can post grpc related questions to >>>> https://groups.google.com/forum/#!forum/grpc-io >>>> >>>> On Tue, Nov 15, 2016 at 4:03 PM, <[email protected]> wrote: >>>> >>>>> I notice that when RPC methods are defined in a proto file, they are >>>>> all sync APIs. Is there a way to define async methods? Thanks. >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Protocol Buffers" 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/protobuf. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Protocol Buffers" 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/protobuf. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" 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/protobuf. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" 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/protobuf. For more options, visit https://groups.google.com/d/optout.
