phpgears / event-async-queue-interop
事件总线异步装饰器的 Queue-interop
0.2
2019-10-01 20:55 UTC
Requires
- php: ^7.1
- phpgears/event-async: ~0.2
- 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-09-17 06:31:22 UTC
README
Queue-interop 异步事件总线
Queue-interop 异步装饰器用于事件总线
安装
Composer
composer require phpgears/event-async-queue-interop
用法
需要 composer 自动加载文件
require './vendor/autoload.php';
异步事件总线
有关异步事件总线的更多信息,请参阅 phpgears/event-async
use Gears\Event\Async\AsyncEventBus; use Gears\Event\Async\QueueInterop\QueueInteropEventQueue; use Gears\Event\Async\Serializer\JsonEventSerializer; use Gears\Event\Async\Discriminator\ParameterEventDiscriminator; /* @var \Gears\Event\EventBus $eventBus */ /* @var \Interop\Queue\PsrContext $context */ /* @var \Interop\Queue\PsrDestination $destination */ $eventQueue = new QueueInteropEventQueue(new JsonEventSerializer(), $context, $destination); $asyncEventBus = new AsyncEventBus( $eventBus, $eventQueue, new ParameterEventDiscriminator('async') ); $asyncEvent = CustomEvent::occurred(['async' => true]); $asyncEventBus->dispatch($asyncEvent);
一些 Queue-interop 实现可用,例如 Enqueue,它支持大量消息队列
贡献
发现了一个错误或有一个功能请求? 请创建一个新问题。在创建问题之前请查看现有问题。
请参阅 CONTRIBUTING.md 文件
许可
请参阅源代码中包含的 LICENSE 文件,以获取许可证条款副本。