bardiz12/swoole-grpc
最新稳定版本:v0.0.1
Composer 安装命令:
composer require bardiz12/swoole-grpc
包简介
GRPC abstraction for swoole to build high performance polygloat services
README 文档
README
This library is a forked version of the original OpenSwoole gRPC library, designed specifically for use with the Swoole PHP Extensions. It provides a modern, high-performance, and coroutine-friendly gRPC server and client implementation for PHP, enabling scalable microservices and efficient inter-service communication. Thanks to
About
Swoole gRPC brings native gRPC support to PHP applications running on Swoole. It is a drop-in, improved, and actively maintained alternative to the OpenSwoole gRPC library, with a focus on code quality, extensibility, and developer experience.
This library is suitable for:
- Building high-performance PHP microservices with gRPC
- Integrating PHP with polyglot (multi-language) gRPC systems
- Leveraging Swoole's coroutine and async features for scalable RPC
Features
- Native gRPC protocol implementation (HTTP/2, Protobuf)
- Coroutine-based server and client for maximum concurrency
- Server-side streaming and unary RPC support
- Client connection pooling and multiplexing
- Middleware/interceptor support for authentication, logging, etc.
- Easy integration with generated PHP stubs from
.protofiles
Installation
Install via Composer:
composer require bardiz12/swoole-grpc
Note: Requires the Swoole PHP Extension v6.0.0 or above to be installed and enabled.
Example Project
https://github.com/bardiz12/swoole-grpc-example
TODO
- Create example usage of this library
- Initialize Unit Tests
- Handle Multiple HTTP Protocol handler (so we can just allocate 1 Swoole Server fot HTTP/1.1 and HTTP/2.0)
- Handle Stream Request
- Refactor Client Pool
Getting Started
- Define your service in a
.protofile - Generate PHP stubs using protoc-gen-swoole-grpc or compatible tools
- Implement your service logic using the generated classes
- Start the gRPC server using Swoole
- Connect with a gRPC client (PHP or any other language)
Documentation
- Refer to the Swoole documentation for server setup and coroutine usage
License
MIT. See LICENSE.
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2025-11-17