定制 bardiz12/swoole-grpc 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 .proto files

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

  1. Define your service in a .proto file
  2. Generate PHP stubs using protoc-gen-swoole-grpc or compatible tools
  3. Implement your service logic using the generated classes
  4. Start the gRPC server using Swoole
  5. Connect with a gRPC client (PHP or any other language)

Documentation

License

MIT. See LICENSE.

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 15
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2025-11-17