Class: GrpcKit::Calls::Server::ClientStreamer
- Inherits:
-
GrpcKit::Call
- Object
- GrpcKit::Call
- GrpcKit::Calls::Server::ClientStreamer
- Includes:
- Enumerable
- Defined in:
- lib/grpc_kit/calls/server_client_streamer.rb
Instance Attribute Summary collapse
-
#outgoing_initial_metadata ⇒ Object
readonly
Returns the value of attribute outgoing_initial_metadata.
-
#outgoing_trailing_metadata ⇒ Object
readonly
Returns the value of attribute outgoing_trailing_metadata.
Attributes inherited from GrpcKit::Call
#metadata, #method, #method_name, #service_name
Instance Method Summary collapse
- #each {|response| ... } ⇒ Object
-
#initialize ⇒ ClientStreamer
constructor
A new instance of ClientStreamer.
-
#recv ⇒ Object
This method is not thread safe, never call from multiple threads at once.
- #send_msg(data) ⇒ void
Methods inherited from GrpcKit::Call
Constructor Details
#initialize ⇒ ClientStreamer
Returns a new instance of ClientStreamer.
14 15 16 17 18 19 |
# File 'lib/grpc_kit/calls/server_client_streamer.rb', line 14 def initialize(**) super @outgoing_initial_metadata = {} @outgoing_trailing_metadata = {} end |
Instance Attribute Details
#outgoing_initial_metadata ⇒ Object (readonly)
Returns the value of attribute outgoing_initial_metadata.
11 12 13 |
# File 'lib/grpc_kit/calls/server_client_streamer.rb', line 11 def @outgoing_initial_metadata end |
#outgoing_trailing_metadata ⇒ Object (readonly)
Returns the value of attribute outgoing_trailing_metadata.
11 12 13 |
# File 'lib/grpc_kit/calls/server_client_streamer.rb', line 11 def @outgoing_trailing_metadata end |
Instance Method Details
#each {|response| ... } ⇒ Object
41 42 43 |
# File 'lib/grpc_kit/calls/server_client_streamer.rb', line 41 def each loop { yield(recv) } end |
#recv ⇒ Object
This method is not thread safe, never call from multiple threads at once.
36 37 38 |
# File 'lib/grpc_kit/calls/server_client_streamer.rb', line 36 def recv @stream.recv_msg(@codec, limit_size: @config.) end |
#send_msg(data) ⇒ void
This method returns an undefined value.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/grpc_kit/calls/server_client_streamer.rb', line 23 def send_msg(data) @stream.send_msg( data, @codec, last: true, initial_metadata: @outgoing_initial_metadata, trailing_metadata: @outgoing_trailing_metadata, limit_size: @config., ) end |