https://github.com/bauhausphp/message-handler
https://github.com/bauhausphp/message-handler
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bauhausphp/message-handler
- Owner: bauhausphp
- License: mit
- Created: 2021-09-25T22:49:55.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-04-17T03:59:20.000Z (about 3 years ago)
- Last Synced: 2024-12-26T20:28:06.534Z (over 1 year ago)
- Language: PHP
- Size: 27.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status]](https://github.com/bauhausphp/message-bus/actions)
[![Coverage]](https://coveralls.io/github/bauhausphp/message-bus?branch=main)
[![Stable Version]](https://packagist.org/packages/bauhaus/message-bus)
[![Downloads]](https://packagist.org/packages/bauhaus/message-bus)
[![PHP Version]](composer.json)
[![License]](LICENSE)
[Build Status]: https://img.shields.io/github/workflow/status/bauhausphp/message-bus/CI?style=flat-square
[Coverage]: https://img.shields.io/coveralls/github/bauhausphp/message-bus?style=flat-square
[Stable Version]: https://img.shields.io/packagist/v/bauhaus/message-bus?style=flat-square
[Downloads]: https://img.shields.io/packagist/dt/bauhaus/message-bus?style=flat-square
[PHP Version]: https://img.shields.io/packagist/php-v/bauhaus/message-bus?style=flat-square
[License]: https://img.shields.io/github/license/bauhausphp/message-bus?style=flat-square
# Message Bus
## Installing
```
$ composer require bauhaus/message-bus
```
# Getting Started
```php
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