spiral/roadrunner-grpc

High-Performance GRPC server for PHP applications

v2.0.1 2022-11-10 10:11 UTC

README

Latest Stable Version build Codecov

RoadRunner GRPC is an open-source (MIT) high-performance PHP GRPC server build at top of RoadRunner. Server support both PHP and Golang services running within one application.

Documentation:

Features:

  • native Golang GRPC implementation compliant
  • minimal configuration, plug-and-play model
  • very fast, low footprint proxy
  • simple TLS configuration
  • debug tools included
  • Prometheus metrics
  • middleware and server customization support
  • code generation using protoc plugin (Plugin can be downloaded from the roadrunner releases page)
  • transport, message, worker error management
  • response error codes over php exceptions
  • works on Windows

Usage:

Install rr and protoc-gen-php-grpc by building it or use pre-build binaries.

Define your service schema using proto file. You can scaffold protobuf classes and GRPC service interfaces using:

$ protoc --php_out=target-dir/ --php-grpc_out=target-dir/ sample.proto

Make sure to install protoc compiler and run composer require spiral/roadrunner-grpc first

Implement needed classes and create worker.php to invoke your services.

Install rr and place .rr.yaml (or any other format supported by viper configurator) into the root of your project. You can run your application now:

$ rr serve

See example.

You can find more details regarding server configuration at RoadRunner Wiki.

License:

MIT License (MIT). Please see LICENSE for more information. Maintained by SpiralScout.