class GRPC::ServerStream(T)

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

Defined in:

grpc/stream.cr

Constructors

Instance Method Summary

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) #

[View source]

Instance Method Detail

def cancel : Nil #

[View source]
def each(& : T -> ) : Nil #
Description copied from module Enumerable(T)

Must yield this collection's elements to the block.


[View source]
def finish(status_override : Status | Nil = nil) : Nil #

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.


[View source]
def headers : Metadata #

[View source]
def push(msg : T) : Nil #

[View source]
def status : Status #

[View source]
def trailers : Metadata #

[View source]