https://github.com/jenkoian/commandbuscommandbus
🚌 Yo dawg, I heard you like command buses, so I put a command bus in your command bus, so you can command bus whilst you command bus
https://github.com/jenkoian/commandbuscommandbus
Last synced: 6 months ago
JSON representation
🚌 Yo dawg, I heard you like command buses, so I put a command bus in your command bus, so you can command bus whilst you command bus
- Host: GitHub
- URL: https://github.com/jenkoian/commandbuscommandbus
- Owner: jenkoian
- Created: 2015-01-09T15:39:27.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-09T15:39:09.000Z (almost 11 years ago)
- Last Synced: 2024-04-08T09:06:19.612Z (almost 2 years ago)
- Language: PHP
- Homepage:
- Size: 203 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
CommandBusCommandBus
=====================

Installation
-------------
```
composer require jenko/command-bus-command-bus
```
Usage
-----
Say you have a controller (or whatever) that looks something like
```php
commandBus = $commandBus;
}
/**
* @param Request $request
*/
public function myAction(Request $request)
{
$stuff = $request->get('stuff');
$command = new MyCommand($stuff);
$this->commandBus->execute($command);
//...
}
}
```
Then depending on your method of DependencyInjection just inject the required adapter for the command bus you want to use.
For example, in Symfony with controllers as services using Broadway:
```yaml
services:
jenko.command_bus.broadway:
class: Jenko\CommandBusCommandBus\BroadwayCommandBusAdapter
arguments:
- @broadway.command_handling.simple_command_bus
acme.my_controller:
class: Acme\Controller\MyController
arguments:
- @jenko.command_bus.broadway
````
Disclaimer
----------
This is a silly little project, you're probably better off just using the command bus which best fits your purpose. All the
command buses used within this project look great, so pick one of the following, don't use this and I'm sure you won't far go wrong :)
- [Broadway](https://github.com/qandidate-labs/broadway)
- [Commander](https://github.com/Enginebit/Commander)
- [Sergeant](https://github.com/acairns/sergeant)
- [SimpleBus](https://github.com/SimpleBus/CommandBus)
- [Tactician](https://github.com/thephpleague/tactician)