Protocol::GRPC
Provides abstractions for working with the gRPC protocol over HTTP/2.
Features
protocol-grpc provides protocol-level abstractions for building gRPC applications:
- Protocol-level abstractions - No networking, no client/server implementations. Focuses on gRPC protocol details.
- Message framing - Handles gRPC's 5-byte length-prefixed message format with compression support.
- Status codes and error handling - Complete gRPC status code support with error hierarchy.
- Metadata and trailers - Full support for gRPC metadata headers and HTTP trailers.
- Interface definitions - Define service contracts using
Protocol::GRPC::Interfacewith PascalCase method names matching.protofiles. - Middleware pattern - Abstract base class for building gRPC server applications.
- Call context - Track deadlines, metadata, and request context for each RPC call.
Following the same pattern as protocol-http, this gem provides only protocol abstractions. Client and server implementations are built on top in separate gems (e.g., async-grpc).
Usage
Please browse the source code index or refer to the guides below.
Getting Started
This guide explains how to use protocol-grpc for building abstract gRPC interfaces.
Releases
Please browse the releases for more details.
v0.4.0
- Add
RPC#name.
v0.3.0
- Breaking:
Protocol::GRPC::Callnow takes aresponseobject parameter instead of separateresponse_headers. - Breaking: Removed
Call#response_headersmethod. Usecall.response.headersdirectly. - Added
RPC#streaming?method to check if an RPC is streaming.
v0.2.0
RPC#methodis always defined (snake case).
v0.1.0
- Initial design.
See Also
- async-grpc — Asynchronous gRPC client and server implementation using this interface.
- protocol-http — HTTP protocol abstractions that gRPC builds upon.
- async-http — Asynchronous HTTP client and server, supporting HTTP/2 which gRPC requires.
Contributing
We welcome contributions to this project.
- Fork it.
- Create your feature branch (
git checkout -b my-new-feature). - Commit your changes (
git commit -am 'Add some feature'). - Push to the branch (
git push origin my-new-feature). - Create new Pull Request.
Developer Certificate of Origin
In order to protect users of this project, we require all contributors to comply with the Developer Certificate of Origin. This ensures that all contributions are properly licensed and attributed.
Community Guidelines
This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.