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
- .new(raw : RawBidiCall, request_marshaller : Marshaller(Req) = ProtoMarshaller(Req).new, response_marshaller : Marshaller(Res) = ProtoMarshaller(Res).new)
- .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, *, final_status_proc : -> Status | Nil = -> do nil.as(Status | ::Nil) end)
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.
-
#final_status : Status | Nil
The transport's terminal RPC status, even while replies remain queued.
- #headers : Metadata
-
#send(message : Req) : Nil
send transmits a request message to the server.
- #status : Status
- #trailers : Metadata
Constructor Detail
def self.new(raw : RawBidiCall, request_marshaller : Marshaller(Req) = ProtoMarshaller(Req).new, response_marshaller : Marshaller(Res) = ProtoMarshaller(Res).new)
#
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, *, final_status_proc : -> Status | Nil = -> do
nil.as(Status | ::Nil)
end)
#
Instance Method Detail
def each(& : Res -> ) : Nil
#
Description copied from module Enumerable(Res)
Must yield this collection's elements to the block.
The transport's terminal RPC status, even while replies remain queued. Nil means the RPC has not finished; close_send alone does not finish it.