Search code examples
rubyprotocol-buffersprotoc

How to use Protocol Buffers 3 in Ruby?


I'm trying to use Protocol Buffers v3 in Ruby.

I'm using standard protoc with the --ruby_out option to generate Ruby source code files from *.proto files. Those generated files have require 'google/protobuf' requirement, so I need to use the google-protobuf gem in order to run this Ruby code.

I'm reading the docs for google-protobuf here:

https://developers.google.com/protocol-buffers/docs/reference/ruby-generated

but I don't see any option to decode a protobuf packet from the stream (i.e. stdin)? It may be fine to decode the packet from a standard buffer, but does this library support decoding packets from a stream? If yes, can anyone point me to a direction on how to do it?


Solution

  • You can try GRPC , the Doc is here

    The gRPC service is defined using protocol buffers