class GRPC::ClientContext

Overview

ClientContext carries per-call options for outbound RPCs.

Example: ctx = GRPC::ClientContext.new( metadata: {"authorization" => "Bearer token"}, deadline: 5.seconds ) reply = client.say_hello(req, ctx: ctx)

Defined in:

grpc/call_context.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(metadata : Hash(String, String) | Metadata = Metadata.new, deadline : Time::Span | Time | Nil = nil) #

[View source]

Instance Method Detail

def deadline : Time | Nil #

[View source]
def deadline=(deadline : Time | Nil) #

[View source]
def effective_metadata : Metadata #

effective_metadata returns the call metadata including grpc-timeout if a deadline is set.


[View source]
def metadata : Metadata #

[View source]
def remaining : Time::Span | Nil #

remaining returns how much time is left before the deadline.


[View source]
def timed_out? : Bool #

[View source]