Sha256: 1778e5e4e387c4bd7156f2ae0844c7f3aec00182fd817d30f764a321541a7407

Contents?: true

Size: 631 Bytes

Versions: 3

Compression:

Stored size: 631 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'

module GrpcKit
  module Rpcs
    # compatible for grpc gem
    class Call
      extend Forwardable

      delegate %i[recv send_msg close_and_recv each].freeze => :@stream

      Name = Struct.new(:name, :receiver)
      Reciver = Struct.new(:class)
      Klass = Struct.new(:service_name)

      attr_reader :metadata, :method

      def initialize(metadata, method_name, service_name, stream)
        @metadata = metadata
        klass = Klass.new(service_name)
        @method = Name.new(method_name, Reciver.new(klass))
        @stream = stream
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
grpc_kit-0.1.3 lib/grpc_kit/rpcs/call.rb
grpc_kit-0.1.2 lib/grpc_kit/rpcs/call.rb
grpc_kit-0.1.1 lib/grpc_kit/rpcs/call.rb