phpgears / cqrs-async-queue-interop
Queue-interop async decorator for CQRS command bus
0.3
2019-10-01 22:11 UTC
Requires
- php: ^7.1
- phpgears/cqrs-async: ~0.3
- queue-interop/queue-interop: ~0.8
Requires (Dev)
- brainmaestro/composer-git-hooks: ^2.1
- friendsofphp/php-cs-fixer: ^2.0
- infection/infection: ^0.9
- phpmd/phpmd: ^2.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ~0.11.12
- phpstan/phpstan-deprecation-rules: ~0.11.2
- phpstan/phpstan-strict-rules: ~0.11.1
- phpunit/phpunit: ^7.0|^8.0
- povils/phpmnd: ^2.0
- roave/security-advisories: dev-master
- sebastian/phpcpd: ^4.0
- squizlabs/php_codesniffer: ^3.0
- thecodingmachine/phpstan-strict-rules: ~0.11.2
This package is auto-updated.
Last update: 2024-11-25 06:32:13 UTC
README
Queue-interop async CQRS
Queue-interop async decorator for CQRS command bus
Installation
Composer
composer require phpgears/cqrs-async-queue-interop
Usage
Require composer autoload file
require './vendor/autoload.php';
Asynchronous Commands Bus
Please review phpgears/cqrs-async for more information on async command bus
use Gears\CQRS\Async\AsyncCommandBus; use Gears\CQRS\Async\QueueInterop\QueueInteropCommandQueue; use Gears\CQRS\Async\Serializer\JsonCommandSerializer; use Gears\CQRS\Async\Discriminator\ParameterCommandDiscriminator; /* @var \Gears\CQRS\CommandBus $commandBus */ /* @var \Interop\Queue\PsrContext $context */ /* @var \Interop\Queue\PsrDestination $destination */ $commandQueue = new QueueInteropCommandQueue(new JsonCommandSerializer(), $context, $destination); $asyncCommandBus new AsyncCommandBus( $commandBus, $commandQueue, new ParameterCommandDiscriminator('async') ); $asyncCommand = new CustomCommand(['async' => true]); $asyncCommandBus->handle($asyncCommand);
There are some queue-interop implementations available such as Enqueue which supports an incredible number of message queues
Contributing
Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before.
See file CONTRIBUTING.md
License
See file LICENSE included with the source code for a copy of the license terms.