lamoda / tactician-queue-bundle
This package is abandoned and no longer maintained.
No replacement package was suggested.
Symfony bundle for lamoda/tactician-queue library
1.1.0
2020-02-06 12:05 UTC
Requires
- php: ^7.1
- doctrine/orm: ^2.6.3
- lamoda/queue-bundle: ^1.0 || ^2.0
- lamoda/tactician-queue: ^1.0
- league/tactician: ^1.0
- league/tactician-bundle: ^1.1.17
- symfony/serializer: ^3.4 || ^4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.14
- phpunit/phpunit: ^7.5.15
- symfony/symfony: ^3.4 || ^4.0
This package is auto-updated.
Last update: 2023-06-06 20:00:33 UTC
README
Library provides middleware that gives you ability to execute commands via Tactician in async or delayed way
Installation
Composer
composer require lamoda/tactician-queue-bundle
Configuration
Before usage, please read the documentation for 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:
- Add extra configuration:
lamoda_tactician_queue: tactician_id: tactician.commandbus # Command bus service id command_serializer_id: lamoda_tactician_queue.default_command_serializer # Symfony serializer
- Add at least one strategy, that will convert commands into jobs:
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 }
- Add queue middleware to the list of tactician middlewares:
tactician: commandbus: default: middleware: - tactician.middleware.locking - lamoda_tactician_queue.middleware # Here it is - tactician.middleware.command_handler
- Now every time you call
<?php $commandBus->handle(new My\SecondCommand());
this command will be published into the queue.