GRPC::ServerContext
ServerContext holds per-call state accessible to server-side RPC handlers.
Example: def say_hello(req : HelloRequest, ctx : GRPC::ServerContext) : HelloReply puts ctx.peer puts ctx.metadata["authorization"]? HelloReply.new(message: "Hello!") end
Constructors
Instance methods
cancelled?
Sourcecheck_active!
check_active! raises a StatusError when the call is no longer active. This lets transport and handlers stop work promptly on cancellation/timeout.
deadline
Sourceinitial_metadata
Sourcemetadata
Sourcepeer
Sourcesend_initial_metadata(metadata : Metadata) : Nil
Adds metadata to the initial HTTP/2 response headers. This must be called before the first response message is written.
timed_out?
Sourcetrailing_metadata
Source