Sha256: 1bbe7dc9cbab9ed462eb417101ca6789eeeb760adcddcbff9a5f74f1f9500a2f
Contents?: true
Size: 1.05 KB
Versions: 36
Compression:
Stored size: 1.05 KB
Contents
require 'protobuf' require 'protobuf/logging' require 'protobuf/rpc/rpc.pb' require 'protobuf/rpc/buffer' require 'protobuf/rpc/env' require 'protobuf/rpc/error' require 'protobuf/rpc/middleware' require 'protobuf/rpc/service_dispatcher' module Protobuf module Rpc module Server def gc_pause ::GC.disable if ::Protobuf.gc_pause_server_request? yield ::GC.enable if ::Protobuf.gc_pause_server_request? end # Invoke the service method dictated by the proto wrapper request object # def handle_request(request_data) # Create an env object that holds different parts of the environment and # is available to all of the middlewares env = Env.new('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 def log_signature @_log_signature ||= "[server-#{self.class.name}]" end end end end
Version data entries
36 entries across 36 versions & 2 rubygems