- PHP and Composer
- Open Swoole
- Open Swoole GRPC
- Open Swoole GRPC Compiler
- google/protobuf or ext-protobuf (Optional)
composer install
# start example GRPC server
php server.php
# run client
php simple_client.php
# run golang client
go run client.go
simple_client.php
: one GRPC call with clientfactory_client.php
: use factory to create clientsplain_client.php
: use lower layer protocolpooling_client.php
: how to use clientpoolserver_streaming_client.php
: receive one way data stream from GRPC serverclient_streaming_client.php
: send one way data stream to GRPC server
- Create
.proto
for your service - Generate PHP stub codes with Open Swoole GRPC Compiler
- Implement your own service
- Integrate with GRPC client
OpenSwoole GRPC code generator is open-sourced software licensed under the Apache 2.0 license.