个人以为开拓本钱非常主要,像pulsar、rocketmq的nodejs客户端,实在也是wrap C库实现的
gRPC定义定义构造体gRPC利用.proto文件进行格式的定义,我们定义示例如下,这是一个大略的Echo程序,即吸收的收入再原封不动地返回回去
syntax = "proto2";package proto;enum Comic { Bleach = 1; Naruto = 2; OnePiece = 3;}message EchoProto2Req { required string str_req = 1; optional string str_opt = 2; repeated string str_rep = 3; required int64 int64_req = 4; optional int32 int32_opt = 5; required Comic comic = 6;}message EchoProto2Resp { required string str_req = 1; optional string str_opt = 2; repeated string str_rep = 3; required int64 int64_req = 4; optional int32 int32_opt = 5; required Comic comic = 6;}
定义service
service EchoProto2Service { rpc EchoProto2(EchoProto2Req) returns (EchoProto2Resp);}
