Skip to content

Client: Installation

Shaun McCormick edited this page Jun 17, 2019 · 1 revision

Installation

gem 'gruf'

Then in an initializer or before use:

require 'gruf'

Make sure to review UPGRADING.md if you are upgrading gruf between minor or major versions.

Client

Add an initializer:

require 'gruf'

Gruf.configure do |c|
  c.default_client_host = 'grpc.service.com:9003'
end

If you don't explicitly set default_client_host, you will need to pass it into the options, like so:

client = ::Gruf::Client.new(service: ::Demo::ThingService, options: {hostname: 'grpc.service.com:9003'})

Next: Client: Making Your First Call