Sha256: 52efeacbf62ee89c154b4e6ca8a3da34d48ee71b327ac2513524c802d0485444

Contents?: true

Size: 856 Bytes

Versions: 15

Compression:

Stored size: 856 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
      # @param stream [GrpcKit::Stream::ServerStream]
      # @param metadata [Hash<String, String>]
      # @return [void]
      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)
          end
        else
          resp = @handler.send(@config.ruby_style_method_name, call)
          call.send_msg(resp)
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
grpc_kit-0.5.1 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.5.0 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.4.0 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.3.9 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.3.8 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.3.7 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.3.6 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.3.5 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.3.4 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.3.3 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.3.2 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.3.1 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.3.0 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.2.1 lib/grpc_kit/rpcs/server_client_streamer.rb
grpc_kit-0.2.0 lib/grpc_kit/rpcs/server_client_streamer.rb