Download the PHP package reactphp-x/register-center without Composer

On this page you can find all versions of the php package reactphp-x/register-center. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package register-center

ReactPHP X 服务注册中心

基于 ReactPHP 构建的高性能分布式服务注册与发现中心,支持服务注册、发现、动态节点管理以及主节点与注册中心之间的实时通信。

特性

系统要求

安装

快速开始

1. 启动注册中心

创建一个注册中心服务器,监听端口 8010:

2. 创建主节点

创建一个主节点并注册服务:

3. 运行示例

高级特性

服务注册与本地调用

1. 服务注册

2. 本地服务调用

远程服务调用

1. 单次远程调用

2. 批量远程调用

3. 异步服务调用模式

4. 服务调用性能优化

服务调用最佳实践

1. 服务设计原则

2. 错误处理策略

3. 性能监控与调试

4. 服务版本管理

身份验证与安全

主节点连接时需要进行身份验证:

动态节点管理

注册中心支持动态添加和移除节点:

服务监控

获取连接状态和服务信息:

完整的日志配置

示例与使用场景

完整示例

examples 目录下提供了完整的工作示例:

运行完整示例

运行后您将看到:

  1. 主节点连接到主注册中心 (8010)
  2. 注册中心定期在主节点上执行服务方法
  3. 10秒后,主注册中心通知主节点连接到从注册中心 (8011)
  4. 20秒后,主注册中心通知主节点断开从注册中心连接

架构说明

使用场景

1. 微服务架构

2. 分布式任务处理

3. 负载均衡

4. 故障转移

当主注册中心不可用时,主节点会自动连接到备用注册中心:

API 参考

Register (注册中心)

构造函数

主要方法

Master (主节点)

构造函数

主要方法

事件

ServiceRegistry (服务注册表)

静态方法

错误处理与调试

错误处理

调试技巧

性能优化

连接池管理

日志级别优化

内存优化

常见问题

Q: 如何处理网络中断?

A: 主节点具备自动重连功能,配置 reconnectOnClose: true 即可在连接断开时自动重连。

Q: 如何在生产环境中使用?

A: 建议使用进程管理器如 Supervisor 来管理进程,并配置适当的日志级别和重试参数。

Q: 支持多少个并发连接?

A: 基于 ReactPHP,可以处理数千个并发连接,具体取决于服务器配置。

Q: 如何扩展到多个注册中心?

A: 使用动态节点管理功能,可以运行时添加和移除注册中心。

贡献

欢迎贡献代码!请遵循以下步骤:

  1. Fork 项目
  2. 创建功能分支 (git checkout -b feature/amazing-feature)
  3. 提交更改 (git commit -m 'Add amazing feature')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 创建 Pull Request

开发环境设置

许可证

本项目采用 MIT 许可证 - 详见 LICENSE 文件


链接


ReactPHP X Register Center - 让分布式服务通信变得简单高效 🚀


All versions of register-center with dependencies

PHP Build Version
Package Version
Requires reactphp-x/tunnel-stream Version ^1.0
psr/log Version ^3.0
react/socket Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package reactphp-x/register-center contains the following files

Loading the files please wait ...