Download the PHP package egret/queue without Composer

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

queue

PHP的一个队列包,目前已有kafka和redis两种队列驱动,实现方式是用swoole的进程池 + symfony的console + enqueue的队列包

kafka队列使用需要先安装 rdkafka 拓展

redis队列的使用需要有一个redis的操作包,这里指定了predis

后续可能会继续拓展新的队列驱动,目前只存在这两种

版本要求

安装教程

建议在composer.json里加上

当然也可以直接composer require,但是这样可执行文件就不会放到跟composer.json同级的bin目录下,比较难找

使用指引

创建一个简单的redis队列

启动队列命令

查看队列

停止队列,需要有PID文件才可以

上面就完成了一个消费者队列的创建

下面展示一下生产者,先创建一个工作类,所有工作类都必须继承AbstractJob

Redis生产者代码

Kafka生产者代码

到这里就完成了队列的生产者和消费者的创建了,还差一个步骤就是把消费者加入到queue命令行中,用命令便可以启动和管理

此处采用文件加载的方式,使用的时候可以在composer.json同级的目录,或者同级的app或者application亦或者src目录下创建console.php,内容示例如下:

必须把console.php存放到指定的几个地方之一,不然读取不到,文件存放位置示例:

创建完后执行./queue便可以看到相关的队列了


All versions of queue with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
ext-swoole Version ^2.0 || ^3.0 || ^4.0
monolog/monolog Version ^1.0
enqueue/rdkafka Version ^0.10
ext-rdkafka Version ^3.0
enqueue/redis Version ^0.10
symfony/console Version ^5.0 || ^3.0 || ^4.0
predis/predis Version ^1.1
guzzlehttp/guzzle Version ^6.5
ext-posix Version *
ext-pcntl Version *
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 egret/queue contains the following files

Loading the files please wait ....