Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lamoda/tactician-queue-bundle
Symfony bundle for lamoda/tactician-queue library
https://github.com/lamoda/tactician-queue-bundle
async bundle lamoda-queue middleware php php7 queue symfony symfony-bundle tactician
Last synced: 3 months ago
JSON representation
Symfony bundle for lamoda/tactician-queue library
- Host: GitHub
- URL: https://github.com/lamoda/tactician-queue-bundle
- Owner: lamoda
- License: mit
- Archived: true
- Created: 2019-04-09T13:04:49.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-06T12:06:11.000Z (almost 5 years ago)
- Last Synced: 2024-09-26T05:32:57.735Z (4 months ago)
- Topics: async, bundle, lamoda-queue, middleware, php, php7, queue, symfony, symfony-bundle, tactician
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 2
- Watchers: 20
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Lamoda Tactician Queue Middleware
=================================[![Build Status](https://travis-ci.org/lamoda/tactician-queue-bundle.svg?branch=master)](https://travis-ci.org/lamoda/tactician-queue-bundle)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/lamoda/tactician-queue-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/lamoda/tactician-queue-bundle/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/lamoda/tactician-queue-bundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/lamoda/tactician-queue-bundle/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/lamoda/tactician-queue-bundle/badges/build.png?b=master)](https://scrutinizer-ci.com/g/lamoda/tactician-queue-bundle/build-status/master)Library provides middleware that gives you ability to execute commands via Tactician in async or delayed way
## Installation
### Composer
```sh
composer require lamoda/tactician-queue-bundle
```## Configuration
Before usage, please read the documentation for [lamoda/queue-bundle](https://github.com/lamoda/queue-bundle)
Bundle provides special middleware for tactician integration. This middleware add supports
of async command execution, event with scheduling.To enable this feature do the following:
1. Add extra configuration:
```yaml
lamoda_tactician_queue:
tactician_id: tactician.commandbus # Command bus service id
command_serializer_id: lamoda_tactician_queue.default_command_serializer # Symfony serializer```
2. Add at least one strategy, that will convert commands into jobs:
```yaml
services:
# ...
several_domain_commands_strategy:
class: Lamoda\TacticianQueue\Middleware\QueueProducerStrategy\CommandsListToCommandJobStrategy
arguments:
- async_command_queue
- async_command_exchange
- [ My\AsyncCommandInterface, My\SecondCommand ]
- 15 # optional delay
tags:
- { name: tactician_queue.job_producing_strategy }
```
3. Add queue middleware to the list of tactician middlewares:
```yaml
tactician:
commandbus:
default:
middleware:
- tactician.middleware.locking
- lamoda_tactician_queue.middleware # Here it is
- tactician.middleware.command_handler
```
4. Now every time you call
```php
handle(new My\SecondCommand());
```
this command will be published into the queue.