Skip to content

About

Transport-independent controllers, routing, middleware and testing for Gritz

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Gritz Core

Transport-independent controllers, routing, middleware, configuration, forked-worker supervision and network-free testing for Ruby gRPC applications. Requires CRuby 3.3 or later. This gem has no grpc dependency. Requiring the core does not load a transport; starting a server loads the selected adapter.

require "gritz/core"

Use gritz for the default framework and executable, or combine this gem with gritz-native for the official grpc gem adapter. The experimental gritz-async adapter runs RPCs in fibers and supports inherited TCP listeners without installing the official grpc gem.

Controller tests can load gritz/testing/rspec or gritz/testing/minitest and run without a network or the grpc gem. See the controller examples and configuration guide.

Gritz::Testing::Server selects the configured adapter for real-socket tests; require that adapter's entrypoint first. Adapter suites explicitly require gritz/testing/transport_contract to run shared wire checks with RSpec, the official grpc client and googleapis-common-protos-types as test dependencies. Production eager loading skips this shared test suite.

Supervised servers support phased replacement, fresh-interpreter hot reexec, request/memory/lifetime recycling, Admin HTTP probes and process-wide Prometheus totals. The CLI keeps one lifecycle owner across master generations; application controllers and gRPC resources stay in serving processes.

Gritz::Client.define creates lazy, fork-safe client constants with deadline propagation, selected request headers and middleware around complete streams. See the client guide. Optional gritz-otel adds server/client spans and worker OTLP metrics after fork.

The optional Gritz::Compat::Gruf module adapts Gruf controllers, returned response streams and server interceptors. gritz-migrate-gruf converts supported static configuration without executing the source file. See the Gruf migration guide. Add gritz-rails for Rails execution, generators and development reloading.

Development

git clone https://github.com/gritzrpc/gritz-core.git
cd gritz-core
bundle install
COVERAGE=1 bundle exec rake
bundle exec rubocop
bundle exec rake build

Tests, lint and packaging run independently in this repository. See CONTRIBUTING.md, SECURITY.md and the release guide.

Documentation

Read the published guides and API reference, public API policy, support policy and stabilization gate.

License

MIT.

About

Transport-independent controllers, routing, middleware and testing for Gritz

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages