class GRPC::RawServerStream

Overview

RawServerStream is the client-side view of a server-streaming or bidi-streaming RPC response. It delivers raw protobuf bytes as they arrive. Generated client stubs wrap this in a typed ServerStream(T) for ergonomic use.

Included Modules

Defined in:

grpc/stream.cr

Constructors

Instance Method Summary

Constructor Detail

def self.build(messages : ::Channel(Bytes | Nil), *, headers_proc : -> Metadata = -> do Metadata.new end, status_proc : -> Status, trailers_proc : -> Metadata = -> do Metadata.new end, cancel_proc : -> Nil = -> do end, on_finish : -> Nil = -> do end) : self #

[View source]
def self.new(messages : ::Channel(Bytes | Nil), status_proc : -> Status, trailers_proc : -> Metadata = -> do Metadata.new end, cancel_proc : -> Nil = -> do end, on_finish : -> Nil = -> do end) #

[View source]

Instance Method Detail

def cancel : Nil #

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

Must yield this collection's elements to the block.


[View source]
def headers : Metadata #

[View source]
def status : Status #

[View source]
def trailers : Metadata #

[View source]
def with_headers(headers_proc : -> Metadata) : self #

[View source]
def with_on_finish(hook : -> Nil) : self #

with_on_finish appends a completion callback and returns self. The callback is invoked once when iteration ends or cancel is called.


[View source]