class
GRPC::BidiCall(Req, Res)
- GRPC::BidiCall(Req, Res)
- Reference
- Object
Overview
BidiCall(Req, Res) is the client handle for a bidirectional streaming RPC. The client sends and receives messages concurrently.
Example: call = client.chat spawn do messages.each { |msg| call.send(msg) } call.close_send end call.each { |reply| pp reply }
Included Modules
- Enumerable(Res)
Defined in:
grpc/stream.crConstructors
Instance Method Summary
- #cancel : Nil
-
#close_send : Nil
close_send signals the end of the client's request stream.
-
#each(& : Res -> ) : Nil
Must yield this collection's elements to the block.
- #headers : Metadata
-
#send(message : Req) : Nil
send transmits a request message to the server.
- #status : Status
- #trailers : Metadata
Constructor Detail
def self.new(send_proc : Req -> _, close_proc : -> _, recv_chan : ::Channel(Exception | Res), headers_proc : -> Metadata = -> do
Metadata.new
end, status_proc : -> Status = -> do
Status.ok
end, trailers_proc : -> Metadata = -> do
Metadata.new
end, cancel_proc : -> Nil = -> do
end)
#
Instance Method Detail
def each(& : Res -> ) : Nil
#
Description copied from module Enumerable(Res)
Must yield this collection's elements to the block.