Class: GrpcKit::Calls::Client::ServerStreamer

Inherits:
GrpcKit::Call show all
Includes:
Enumerable
Defined in:
lib/grpc_kit/calls/client_server_streamer.rb

Instance Attribute Summary

Attributes inherited from GrpcKit::Call

#metadata, #method, #method_name, #service_name

Instance Method Summary collapse

Methods inherited from GrpcKit::Call

#deadline, #initialize

Constructor Details

This class inherits a constructor from GrpcKit::Call

Instance Method Details

#each {|response| ... } ⇒ Object

Yield Parameters:

  • response (Object)

    each response object of server streaming RPC



26
27
28
# File 'lib/grpc_kit/calls/client_server_streamer.rb', line 26

def each
  loop { yield(recv) }
end

#recvObject

This method is not thread safe, never call from multiple threads at once.

Returns:

  • (Object)

    response object



21
22
23
# File 'lib/grpc_kit/calls/client_server_streamer.rb', line 21

def recv
  @stream.recv_msg
end

#send_msg(data) ⇒ void

This method returns an undefined value.

Parameters:

  • data (Object)

    request message



15
16
17
# File 'lib/grpc_kit/calls/client_server_streamer.rb', line 15

def send_msg(data)
  @stream.send_msg(data, last: true, metadata: )
end