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
- .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)
-
.new(raw : RawServerStream, marshaller : Marshaller(T) = ProtoMarshaller(T).new)
Decode at the application handoff so the transport's byte budget covers every queued response, without an extra forwarding fiber or typed queue.
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
Decode at the application handoff so the transport's byte budget covers every queued response, without an extra forwarding fiber or typed queue.
Instance Method Detail
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.