PHPackages                             gos/react-amqp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. gos/react-amqp

ActiveLibrary[Queues &amp; Workers](/categories/queues)

gos/react-amqp
==============

AMQP bindings for ReactPHP

v0.3.0(6y ago)1690.5k↓40%5MITPHPPHP &gt;=7.2

Since Aug 2Pushed 6y ago3 watchersCompare

[ Source](https://github.com/GeniusesOfSymfony/ReactAMQP)[ Packagist](https://packagist.org/packages/gos/react-amqp)[ RSS](/packages/gos-react-amqp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (6)Used By (0)

ReactAMQP
=========

[](#reactamqp)

[![Build Status](https://camo.githubusercontent.com/8d202c32f6771361cf4b3cc71a1b3399e3a76046176fe67f47612fb10053b6ed/68747470733a2f2f7472617669732d63692e6f72672f47656e69757365734f6653796d666f6e792f5265616374414d51502e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/GeniusesOfSymfony/ReactAMQP)

Basic AMQP bindings for [React PHP](https://github.com/reactphp).

Install
-------

[](#install)

This library requires PHP &gt;=7.1 and the [PECL AMQP extension](http://pecl.php.net/package/amqp). The best way to install this library is [through composer](http://getcomposer.org).

> Please, checkout 1.x version for PHP-5.x.

```
composer require gos/react-amqp
```

Usage
-----

[](#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

[](#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.

```
