PHPackages                             mnk1985/amqp-tasks-bundle - 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. mnk1985/amqp-tasks-bundle

ActiveSymfony-bundle[Queues &amp; Workers](/categories/queues)

mnk1985/amqp-tasks-bundle
=========================

Simple Async Task Queue, Based On RabbitMQ Queues

v1.2.1(7y ago)015MITPHPPHP ^7.1.3

Since May 17Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mnk1985/amqp-tasks)[ Packagist](https://packagist.org/packages/mnk1985/amqp-tasks-bundle)[ RSS](/packages/mnk1985-amqp-tasks-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

Installation
------------

[](#installation)

```
composer require mnk1985/amqp-tasks-bundle
```

add RabbitMQ connection details to .env file. e.g.

```
RABBITMQ_HOST=localhost
RABBITMQ_PORT=5672
RABBITMQ_USER=guest
RABBITMQ_PASSWORD=guest

```

**Note:** As long as you are on Symfony Flex you are done. If not, you have to do some extra things, like registering the bundle in your `AppKernel` class.

Base components:
----------------

[](#base-components)

- Task - stores queue name in the underlying queue system, knows its handler and dto serializer
- DTO - data structure which stores all the data we need to pass in order to be able to process job asynchronously (e.g. to make async search we can pass some filter details)
- DTOSerializer - is an object which can transform dto to string and vice versa
- TaskHandler - receives dto and does processing (any components can be injected if needed)

UML class diagram may be helpful for visualization [![](Resources/img/uml.png)](Resources/img/uml.png)

Examples
--------

[](#examples)

Task (should implement TaskInterface or extend AbstractTask). getQueueName should return real queue name used to store/retrieve data from queue driver. TestTask::getDTOSerializer returns specific to your task serializer. TestTask::getHandler returns task's handler. The convention is that handler comes with 'Handler' suffix to task name (e.g. from TestTask we get TestTaskHandler, but it can be overwritten via TestTask::setHandler)

```
