def rpc(rpc_method, input_class, output_class, opts)
      raise ArgumentError.new("rpc_method can not be empty") if rpc_method.to_s.empty?
      raise ArgumentError.new("input_class must be a Protobuf Message class") unless input_class.is_a?(Class)
      raise ArgumentError.new("output_class must be a Protobuf Message class") unless output_class.is_a?(Class)
      raise ArgumentError.new("opts[:ruby_method] is mandatory") unless opts && opts[:ruby_method]

      rpcdef = {
        rpc_method: rpc_method.to_sym, # as defined in the Proto file.
        input_class: input_class, # google/protobuf Message class to serialize the input (proto request).
        output_class: output_class, # google/protobuf Message class to serialize the output (proto response).
        ruby_method: opts[:ruby_method].to_sym, # method on the handler or client to handle this rpc requests.
      }

      @rpcs ||= {}
      @rpcs[rpc_method.to_s] = rpcdef

      rpc_define_method(rpcdef) if respond_to? :rpc_define_method # hook for the client to implement the methods on the class
    end
def rpc(rpc_method, input_class, output_class, opts)
      raise ArgumentError.new("rpc_method can not be empty") if rpc_method.to_s.empty?
      raise ArgumentError.new("input_class must be a Protobuf Message class") unless input_class.is_a?(Class)
      raise ArgumentError.new("output_class must be a Protobuf Message class") unless output_class.is_a?(Class)
      raise ArgumentError.new("opts[:ruby_method] is mandatory") unless opts && opts[:ruby_method]

      rpcdef = {
        rpc_method: rpc_method.to_sym, # as defined in the Proto file.
        input_class: input_class, # google/protobuf Message class to serialize the input (proto request).
        output_class: output_class, # google/protobuf Message class to serialize the output (proto response).
        ruby_method: opts[:ruby_method].to_sym, # method on the handler or client to handle this rpc requests.
      }

      @rpcs ||= {}
      @rpcs[rpc_method.to_s] = rpcdef

      rpc_define_method(rpcdef) if respond_to? :rpc_define_method # hook for the client to implement the methods on the class
    end
Configure service rpc methods.