Class: GrpcKit::Interceptors::Server::Streaming

Inherits:
Object
  • Object
show all
Defined in:
lib/grpc_kit/interceptors.rb

Direct Known Subclasses

ClientStreamer, ServerStreamer

Instance Method Summary collapse

Constructor Details

#initialize(interceptors) ⇒ Streaming

Returns a new instance of Streaming.



38
39
40
# File 'lib/grpc_kit/interceptors.rb', line 38

def initialize(interceptors)
  @interceptors = interceptors
end

Instance Method Details

#intercept(call, &block) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/grpc_kit/interceptors.rb', line 42

def intercept(call, &block)
  if @interceptors && !@interceptors.empty?
    do_intercept(@interceptors.dup, call, &block)
  else
    yield(call)
  end
end