phpgears/event-symfony-messenger
Composer 安装命令:
composer require phpgears/event-symfony-messenger
包简介
Event bus implementation with Symfony's Event Dispatcher
README 文档
README
Event bus with Symfony's Messenger
Event bus implementation with Symfony's Messenger
Installation
Composer
composer require phpgears/event-symfony-messenger
Usage
Require composer autoload file
require './vendor/autoload.php';
Events Bus
use Gears\Event\Symfony\Messenger\EventHandlerLocator; use Gears\Event\Symfony\Messenger\EventBus; use Symfony\Component\Messenger\MessageBus; use Symfony\Component\Messenger\Middleware\HandleMessageMiddleware; $eventToHandlerMap = []; /* * IMPORTANT! Events can go through messageBus without being handled, set second argument * on Symfony's EventHandlerLocator constructor ($allowNoHandlers) to true */ $handlerLocator = new EventHandlerLocator($eventToHandlerMap, true); $messengerBus = new MessageBus([new HandleMessageMiddleware($handlerLocator)]); $eventBus = new EventBus($messengerBus); /** @var \Gears\Event\Event $event */ $eventBus->handle($event);
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.
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-03