Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

Latest commit

 

History

History

ruby

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

grpclb/ruby

Gem Version

Ruby implementation of grpclb client and server.

Client

require 'grpclb/client' # or just 'grpclb'

# construct client:
client = Grpclb::Client.new('127.0.0.1:8383', 'service-name', HelloWorld::V1::Stub)

# call methods:
client.say_hello(HelloWorld::HelloRequest.new(...))

Creates and maintains a load-balanced connection for given service stub.

Automatically reconnects on UNAVAILABLE errors.

Server

require 'grpclb/server' # or just 'grpclb'

# construct server:
server = Grpclb::Server.new(...) # just a subclass of GRPC::RpcServer, same initialize args

# handle services:
server.handle(HelloWorld::V1::ServiceImpl) # or .handle(HelloWorld::V1::ServiceImpl.new)

# set up and run:
server.add_http2_port '127.0.0.1:8080', :this_port_is_insecure
server.run_till_terminated

Subclass of GRPC::RpcServer, that takes care of grpclb load reporting.