php-grpc

:electric_plug: Fast and furious GRPC server for PHP applications

Github星跟踪图

PHP-GRPC

Latest Stable Version
GoDoc
Build Status
Go Report Card
Codecov

PHP-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.

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 (go get github.com/spiral/php-grpc/cmd/protoc-gen-php-grpc)
  • transport, message, worker error management
  • response error codes over php exceptions
  • works on Windows

Usage:

Install rr-grpc 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/php-grpc first

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

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

$ rr-grpc serve -v -d

To reset workers state:

$ rr-grpc grpc:reset

To show workers statistics:

$ rr-grpc grpc:workers -i

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.

主要指标

概览
名称与所有者spiral-modules/php-grpc
主编程语言Go
编程语言PHP (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2018-10-10 07:19:39
推送于2022-01-20 20:24:02
最后一次提交2022-01-20 23:24:02
发布数21
最新版本名称v1.6.0 (发布于 )
第一版名称v1.0.0 (发布于 )
用户参与
星数477
关注者数24
派生数48
提交数316
已启用问题?
问题数45
打开的问题数0
拉请求数25
打开的拉请求数0
关闭的拉请求数9
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?