module GRPC

Nested Classes and Modules

module Body
class Call

Represents context for a single RPC call.

class Error

Base exception class for gRPC errors

class Cancelled

Represents a cancelled gRPC operation.

class InvalidArgument

Represents an invalid argument error.

class DeadlineExceeded

Represents a deadline exceeded error.

class NotFound

Represents a not found error.

class Internal

Represents an internal server error.

class Unavailable

Represents an unavailable service error.

class Unauthenticated

Represents an unauthenticated error.

module Header
module HealthCheck
class Streaming

Wrapper class to mark a message type as streamed. Used with the stream() helper method in RPC definitions.

class Interface

Represents an interface definition for gRPC methods. Can be used by both client stubs and server implementations.

module Metadata

Provides operations for building and extracting gRPC metadata.

class Middleware

Represents server middleware for handling gRPC requests. Implements Protocol::HTTP::Middleware interface. Subclasses should implement Protocol::GRPC::Middleware#dispatch to handle service routing and protocol details.

module Route

Provides operations for parsing and building gRPC request paths.

module Status

Provides gRPC status codes and their names.

Definitions

HEADER_POLICY

Custom header policy for gRPC. Extends Protocol::HTTP::Headers::POLICY with gRPC-specific headers.

Implementation

HEADER_POLICY = Protocol::HTTP::Headers::POLICY.merge(
	# Request headers:
	"grpc-timeout" => Header::Timeout,
	"grpc-encoding" => Header::Encoding,
	
	# Response headers:
	"grpc-status" => Header::Status,
	"grpc-message" => Header::Message
	# By default, all other headers follow standard HTTP policy, but gRPC allows most metadata to be sent as trailers.
).freeze