bauhaus/message-bus
Composer 安装命令:
composer require bauhaus/message-bus
包简介
Yet another message bus implementation
关键字:
README 文档
README
Message Bus
Installing
$ composer require bauhaus/message-bus
Getting Started
<?php use Bauhaus\MessageBus; use Bauhaus\MessageBusSettings; class YourCommand {} class YourCommandHandler { public function __invoke(CommandA $command): void {} } class YourQuery {} class YourQueryResult {} class YourQueryHandler { public function __invoke(YourQuery $query): YourQueryResult { return new YourQueryResult(); } } $messageBus = MessageBus::build( MessageBusSettings::new() ->withPsrContainer(/* Pass here your favorite PSR container */) ->withHandlers( YourCommandAHandler::class, YourQueryHandler::class, ); ); $result = $messageBus->dispatch(new YourCommand()); is_null($result); // true $result = $messageBus->dispatch(new YourCommand()); $result instanceof YourQueryResult; // true
Contributing
Open an issue: https://github.com/bauhausphp/message-bus/issues Code: https://github.com/bauhausphp/contributor-tool
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-25