Class: GrpcKit::Calls::Server::BidiStreamer
- Inherits:
-
GrpcKit::Call
- Object
- GrpcKit::Call
- GrpcKit::Calls::Server::BidiStreamer
- Includes:
- Enumerable
- Defined in:
- lib/grpc_kit/calls/server_bidi_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 ⇒ BidiStreamer
constructor
A new instance of BidiStreamer.
-
#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 ⇒ BidiStreamer
Returns a new instance of BidiStreamer.
14 15 16 17 18 19 |
# File 'lib/grpc_kit/calls/server_bidi_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_bidi_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_bidi_streamer.rb', line 11 def @outgoing_trailing_metadata end |
Instance Method Details
#each {|response| ... } ⇒ Object
40 41 42 |
# File 'lib/grpc_kit/calls/server_bidi_streamer.rb', line 40 def each loop { yield(recv) } end |
#recv ⇒ Object
This method is not thread safe, never call from multiple threads at once.
35 36 37 |
# File 'lib/grpc_kit/calls/server_bidi_streamer.rb', line 35 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 |
# File 'lib/grpc_kit/calls/server_bidi_streamer.rb', line 23 def send_msg(data) @stream.send_msg( data, @codec, initial_metadata: @outgoing_initial_metadata, trailing_metadata: @outgoing_trailing_metadata, limit_size: @config., ) end |