module Protobuf::Rpc::Server

Public Instance Methods

gc_pause() { || ... } click to toggle source
# File lib/protobuf/rpc/server.rb, line 13
def gc_pause
  ::GC.disable if ::Protobuf.gc_pause_server_request?

  yield

  ::GC.enable if ::Protobuf.gc_pause_server_request?
end
handle_request(request_data, env_data = {}) click to toggle source

Invoke the service method dictated by the proto wrapper request object

# File lib/protobuf/rpc/server.rb, line 23
def handle_request(request_data, env_data = {})
  # Create an env object that holds different parts of the environment and
  # is available to all of the middlewares
  env = Env.new(env_data.merge('encoded_request' => request_data, 'log_signature' => log_signature))

  # Invoke the middleware stack, the last of which is the service dispatcher
  env = Rpc.middleware.call(env)

  env.encoded_response
end
log_signature() click to toggle source
# File lib/protobuf/rpc/server.rb, line 34
def log_signature
  @_log_signature ||= "[server-#{self.class.name}]"
end