Download the PHP package hsldymq/bugs-bunny without Composer

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

Bugs Bunny: 弹性的多进程RabbitMQ Consumer

Test

运行要求

安装

composer require hsldymq/bugs-bunny

这是什么?

Bugs Bunny是一个弹性的多进程RabbitMQ消费者库,它基于bunny/bunny,reactphp/event-loop,hsldymq/whisper.

它提供一种能力,能够根据队列消息数量的多少动态地调整消费者数量,从而降低因单个消费者处理能力低下而导致队列消息阻塞不能及时处理;也因为其动态的特性在消息数量少的情况,主动减少消费者数量降低无意义的系统开销.

为什么要使用这个库而不是现存的其他方案?

目前绝大多数方案都是基于进程阻塞消费,即当有消息时候执行处理函数,没有消息的时候会持续阻塞等待.

当然像php-amqplib/php-amqplib这样的库是提供同步非阻塞的方式运行,但绝不是一个理想的方式,没人愿意在循环中空跑浪费资源.

于是这带来了一些问题:

其实这些问题你都不用再关心, Bugs Bunny就是为了解决这些问题.

如何解决的?

不同于常见的阻塞方案,Bugs Bunny使用master/worker进程的方式,master进程(也叫做dispatcher)负责消费,调度worker进程,并将消息分配给worker进程,worker则只负责处理消息.

dispatcher连接到AMQP服务器,创建的worker进程也通过socket pair进行进程间通讯,所有连接的文件描述符都通过reachphp/event-loop库进行IO复用

这就解决了消费者数量无法动态调整的问题:

worker不关心消息源,只关心消息本身.有消息就处理,没消息就等待或这退出

dispatcher监听两方消息,由AMQP服务器发来的队列消息,dispatcher将它派发给闲置的worker,没有空闲就创建一个.同时他也接受来自worker的空闲和退出通知,用来调整的它的派发策略,并管理worker的安全退出.

示例

更多

你可以通过查看examples目录中的代码来了解更多的信息


All versions of bugs-bunny with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1 || ^8.0
bunny/bunny Version ^0.5
hsldymq/whisper Version ^0.4
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 hsldymq/bugs-bunny contains the following files

Loading the files please wait ....