Skip to content

v0.9.0 - Ruby & PHP gRPC Streaming Handlers

Choose a tag to compare

@Goldziher Goldziher released this 10 Jan 20:09
v0.9.0
1744c21

Added

  • Ruby gRPC Streaming Handlers: Full implementation of all 4 streaming modes for Ruby bindings

    • RubyGrpcRequest/RubyGrpcResponse wrapper types for Ruby FFI
    • RubyGrpcHandler implementing GrpcHandler trait with unary, server, client, and bidirectional streaming
    • DOS protection limits (payload size, metadata entries/size, stream message count, total bytes)
    • Handler timeout (30 seconds) to prevent hung handlers
    • SAFETY-documented unsafe blocks for Ruby GVL handling
    • Error message sanitization (log full errors, return generic messages to clients)
    • Magnus Ruby FFI integration with Opaque for proper GVL management
  • PHP gRPC Streaming Handlers: Full implementation of all 4 streaming modes for PHP bindings

    • PhpGrpcRequest/PhpGrpcResponse wrapper types for PHP FFI
    • PhpGrpcHandler implementing GrpcHandler trait
    • DOS protection and timeout handling matching Ruby implementation
  • gRPC Streaming Fixture Integration (Phases 1-4): Complete end-to-end fixture infrastructure for all 4 streaming modes

    • 30+ JSON fixture files covering Unary, ServerStreaming, ClientStreaming, and BidirectionalStreaming modes
    • Schema validation with semantic cross-reference checks
    • Cross-language parity tests verifying identical behavior across all 5 languages
    • Metadata and timeout support in all gRPC clients (Python, TypeScript, Ruby, PHP, Rust)
  • gRPC Fixture Testing Suite (120+ cross-language tests):

    • Python: 30+ parametrized pytest tests with fixture loading, 80%+ code coverage
    • TypeScript: 30+ vitest tests with metadata support and stream assertions
    • Ruby: 30+ RSpec tests with block-based connection management and cleanup
    • PHP: 30+ PHPUnit tests with PSR-12 compliance and 85%+ coverage

Changed

  • GrpcHandler trait breaking changes (semver major):
    • Removed supports_streaming_requests() method (replaced by rpc_mode())
    • Removed supports_streaming_responses() method (replaced by rpc_mode())
    • Added rpc_mode() -> RpcMode method with default implementation returning RpcMode::Unary
    • Added call_server_stream() method with UNIMPLEMENTED default for backward compatibility

See CHANGELOG.md for full details and migration guide.