项目作者: cookpad

项目描述 :
A kit for creating gRPC server/client in Ruby.
高级语言: Ruby
项目地址: git://github.com/cookpad/grpc_kit.git
创建时间: 2018-10-04T15:36:59Z
项目社区:https://github.com/cookpad/grpc_kit

开源协议:MIT License

下载


GrpcKit

Build Sttaus
Gem Version

A kit for creating gRPC server/client in Ruby.

Installation

Add this line to your application’s Gemfile:

  1. gem 'grpc_kit'

And then execute:

  1. $ bundle

Or install it yourself as:

  1. $ gem install grpc_kit

Usage

More Details in examples directory.

Server
  1. sock = TCPServer.new(50051)
  2. server = GrpcKit::Server.new
  3. server.handle(GreeterServer.new)
  4. loop do
  5. conn = sock.accept
  6. server.run(conn)
  7. end
Client
  1. sock = TCPSocket.new('localhost', 50051)
  2. stub = Helloworld::Greeter::Stub.new(sock)
  3. message = stub.say_hello(Helloworld::HelloRequest.new(name: 'your name')).message
  4. puts message

Development

  1. $ bundle install

Projects using grpc_kit

  • griffin Multi process gRPC server in Ruby

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/cookpad/grpc_kit.

License

The gem is available as open source under the terms of the MIT License.