Skip to content

Server: Installation

Shaun McCormick edited this page Jun 17, 2019 · 5 revisions

Installing gruf as a server is fairly straightforward. First, add the gem to your Gemfile:

gem 'gruf'

Then in an initializer or before use:

require 'gruf'

You can configure and customize Gruf further:

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

GRPC::RpcServer configuration

To customize parameters for the underlying GRPC::RpcServer, such as the size of the gRPC thread pool, you can pass them in via Gruf.rpc_server_options.

Gruf.configure do |c|
  # The size of the underlying thread pool. No more concurrent requests can be made
  # than the size of the thread pool.
  c.rpc_server_options[:pool_size] = 100
end

Upgrading

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


Next: Generating Stubs