Sha256: dcc163f3b2916fd2f25662b0f8207f6b869fede39acdc3ffc26fd9022d59685e

Contents?: true

Size: 715 Bytes

Versions: 5

Compression:

Stored size: 715 Bytes

Contents

# frozen_string_literal: true

require 'grpc_kit/rpcs'
require 'grpc_kit/calls/server_client_streamer'

module GrpcKit
  module Rpcs::Server
    class ClientStreamer < GrpcKit::Rpcs::ServerRpc
      def invoke(stream, metadata: {})
        call = GrpcKit::Calls::Server::ClientStreamer.new(metadata: metadata, config: @config, stream: stream)

        if @config.interceptor
          @config.interceptor.intercept(call) do |c|
            resp = @handler.send(@config.ruby_style_method_name, c)
            c.send_msg(resp, last: true)
          end
        else
          resp = @handler.send(@config.ruby_style_method_name, call)
          call.send_msg(resp, last: true)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
grpc_kit-0.1.8 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.1.7 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.1.6 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.1.5 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.1.4 lib/grpc_kit/rpcs/server_client_streamer.rb