class
GRPC::ServerStream(T)
- GRPC::ServerStream(T)
- Reference
- Object
Overview
ServerStream(T) is the client's view of a server-streaming RPC response. It supports typed iteration over response messages.
Example (client streaming RPC): stream = client.list_features(rect) stream.each do |feature| pp feature end puts stream.status
Included Modules
- Enumerable(T)
Defined in:
grpc/stream.crConstructors
Instance Method Summary
- #cancel : Nil
-
#each(& : T -> ) : Nil
Must yield this collection's elements to the block.
-
#finish(status_override : Status | Nil = nil) : Nil
finish signals end of stream.
- #headers : Metadata
- #push(msg : T) : Nil
- #status : Status
- #trailers : Metadata
Constructor Detail
def self.new(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(& : T -> ) : Nil
#
Description copied from module Enumerable(T)
Must yield this collection's elements to the block.
finish signals end of stream. Pass a status_override only for error cases; on the normal path status comes from the transport via @status_proc.