phpgears / event-sourcing-async
事件源基础
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-09-07 10:04:13 UTC
README
事件源异步
事件源事件和异步事件总线异步装饰器
安装
Composer
composer require phpgears/event-sourcing-async
用法
需要 composer 自动加载文件
require './vendor/autoload.php';
此包添加了一个新的 Gears\EventSourcing\Async\Serializer\JsonEventSerializer
序列化器,作为一个通用的序列化器,允许在事件由其他系统处理时具有最大兼容性,以便 Gears\EventSourcing\Event\AggregateEvent
事件可以在异步事件总线中使用
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);
有关更多信息,请参阅 phpgears/event-async
贡献
发现了一个错误或有一个功能请求? 请创建一个新的问题。在创建问题之前,请查看现有的问题。
请参阅 CONTRIBUTING.md 文件
许可证
有关许可证条款的副本,请参阅源代码中包含的 LICENSE 文件