Sha256: 1512c4c9125537509f3b55e50629841198bc4c832bc9d370b31acf0cfc0ecdfa

Contents?: true

Size: 805 Bytes

Versions: 15

Compression:

Stored size: 805 Bytes

Contents

# frozen_string_literal: true

require 'grpc_kit/rpcs'
require 'grpc_kit/calls/server_bidi_streamer'

module GrpcKit
  module Rpcs::Server
    class BidiStreamer < GrpcKit::Rpcs::ServerRpc
      # @param stream [GrpcKit::Stream::ServerStream]
      # @param metadata [Hash<String, String>]
      # @return [void]
      def invoke(stream, metadata: {})
        call = GrpcKit::Calls::Server::BidiStreamer.new(
          metadata: metadata,
          config: @config,
          stream: stream,
        )

        if @config.interceptor
          @config.interceptor.intercept(call) do |c|
            @handler.send(@config.ruby_style_method_name, c)
          end
        else
          @handler.send(@config.ruby_style_method_name, call)
        end

        stream.send_status
      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_bidi_streamer.rb
grpc_kit-0.5.0 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.4.0 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.3.9 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.3.8 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.3.7 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.3.6 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.3.5 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.3.4 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.3.3 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.3.2 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.3.1 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.3.0 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.2.1 lib/grpc_kit/rpcs/server_bidi_streamer.rb
grpc_kit-0.2.0 lib/grpc_kit/rpcs/server_bidi_streamer.rb