phpgears / event-sourcing-async
Event Sourcing base
dev-master
2020-03-07 00:23 UTC
Requires
- php: ^7.1
- ext-json: *
- phpgears/event-async: ~0.2.1
- phpgears/event-sourcing: dev-master
Requires (Dev)
- brainmaestro/composer-git-hooks: ^2.8
- friendsofphp/php-cs-fixer: ^2.16
- infection/infection: ^0.13|^0.15
- overtrue/phplint: ^1.2
- phpmd/phpmd: ^2.8
- phpstan/extension-installer: ^1.0.3
- phpstan/phpstan: ^0.12
- phpstan/phpstan-deprecation-rules: ^0.12
- phpstan/phpstan-strict-rules: ^0.12
- phpunit/phpunit: ^7.5|^8.0
- povils/phpmnd: ^2.1
- roave/security-advisories: dev-master
- sebastian/phpcpd: ^4.0
- squizlabs/php_codesniffer: ^3.5
- thecodingmachine/phpstan-strict-rules: ^0.12
This package is auto-updated.
Last update: 2024-11-07 10:34:55 UTC
README
Event Sourcing Async
Async decorator for Event Sourcing events and Async Event Bus
Installation
Composer
composer require phpgears/event-sourcing-async
Usage
Require composer autoload file
require './vendor/autoload.php';
This package adds a new Gears\EventSourcing\Async\Serializer\JsonEventSerializer
serializer, as a general serializer allowing maximum compatibility in case of events being handled by other systems, to allow Gears\EventSourcing\Event\AggregateEvent
events to be used in Async event bus
use Gears\Event\Async\AsyncEventBus; use Gears\EventSourcing\Async\Serializer\JsonEventSerializer; use Gears\Event\Async\Discriminator\ParameterEventDiscriminator; /* @var \Gears\Event\EventBus $eventBus */ /* @var Gears\Event\Async\EventQueue $eventQueue */ $eventQueue = new CustomEventQueue(new JsonEventSerializer()); $asyncEventBus new AsyncEventBus( $eventBus, $eventQueue, new ParameterEventDiscriminator('async') ); $asyncEvent = new CustomEvent(['async' => true]); $asyncEventBus->dispatch($asyncEvent);
Refer to phpgears/event-async for more information
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.