Download the PHP package xd/queue-consumers-manager without Composer

On this page you can find all versions of the php package xd/queue-consumers-manager. 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 queue-consumers-manager

consumers manager

一个简单的队列消费者进程管理轮子,主要为了解决平滑重启、平滑关闭、进程自动平滑重启等问题

原理

本想用信号量来控制进程,实测此方案会出现业务闪断(在收到信号量时,php会断掉当前正在阻塞的语句,可能会导致调用api或执行sql等阻塞操作的中断),因此本项目采用了文件的方式来控制进程。进程自重启是为了防止进程内存泄露的问题,您可以配置一个进程最多消费多少次队列消息后重启,进程会记录处理消费数量,达到最大值便会重新拉起一个进程并退出当前进程,由于新拉起的进程是直接使用的exec函数,且直接执行php命令,因此需要开放exec函数且php已存在于环境变量中

依赖

php >= 5.4 (理论上是>=5.3即可,我没有此环境且版本太老就没验证)
posix 扩展 此扩展不是必须的,只是在记录运行日志时会详细到某一个pid

安装

composer地址:https://packagist.org/packages/xd/queue-consumers-manager

权限

由于采用了文件方式来控制进程,所以需要给目录data读写权限

示例

  1. 创建一个消费者

  2. 启动
    执行对应vendor包中的start.sh, 第三个参数为消费者脚本路径(目前只支持绝对路径),第四个参数为开启的进程个数,运行后中途可以随意再增加,运行日志的名称为consumer脚本的文件名+.log,位于/var/log目录下

    输出

  3. 查看运行状态
    执行对应vendor包中的status.sh, 第三个参数为消费者脚本路径(目前只支持绝对路径)

    输出

  4. 关闭
    执行对应vendor包中的shutdown.sh, 第三个参数为消费者脚本路径(目前只支持绝对路径)

    输出


All versions of queue-consumers-manager with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
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 xd/queue-consumers-manager contains the following files

Loading the files please wait ....