Class: GrpcKit::Interceptors::Client::Streaming

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

Direct Known Subclasses

ClientStreamer, ServerStreamer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStreaming

Returns a new instance of Streaming.



9
10
11
12
# File 'lib/grpc_kit/interceptors/streaming.rb', line 9

def initialize
  # Cant' get interceptor at definition time...
  @interceptors = nil
end

Instance Attribute Details

#interceptors=(value) ⇒ Object (writeonly)

Sets the attribute interceptors

Parameters:

  • value

    the value to set the attribute interceptors to.



7
8
9
# File 'lib/grpc_kit/interceptors/streaming.rb', line 7

def interceptors=(value)
  @interceptors = value
end

Instance Method Details

#intercept(call, &block) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/grpc_kit/interceptors/streaming.rb', line 14

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