Download the PHP package gos/react-amqp without Composer
On this page you can find all versions of the php package gos/react-amqp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package react-amqp
ReactAMQP
Basic AMQP bindings for React PHP.
Install
This library requires PHP >=7.1 and the PECL AMQP extension. The best way to install this library is through composer.
Please, checkout 1.x version for PHP-5.x.
Usage
This library provides two classes, an AMQP Consumer and Producer. Both classes work with a periodic timer and you supply the timer interval as an argument to the constructor.
Consumer
The consumer class allows you to receive messages from an AMQP broker and to dispatch a callback whenever one is received. You can also supply a number of messages to consume in one go, making sure that your event loop isn't perpetually stuck consuming messages from a broker. The callback you supply must accept an AMQPEnvelope as the first argument and an optional AMQPQueue as the second.
Producer
The producer class allows you to send messages to an AMQP exchange. The producer has a publish method that has exactly the same method signature as the AMQPExchange's publish method. Messages are stored in the producer class and sent based on the timer interval passed to the constructor. When the producer object is invoked to send any queued messages the AMQPExchange objects publish method is used. This method is blocking, which may be a performance concern for your application. When a message is successfully sent a 'produce' event is emitted that you can bind a callback to. This is passed an array containing all of the message parameters sent. If an AMQPExchangeException is thrown, meaning the message could not be sent, an 'error' event is emitted that you can bind a callback to. This will be passed the AMQPExchangeException object for you to handle.
All versions of react-amqp with dependencies
ext-amqp Version *
evenement/evenement Version ^3.0
react/event-loop Version ^1.0