dev-master
9999999-devcontainer-interop aware command-bus
MIT
The Requires
The Development Requires
by Glenn Eggeton
1.0.0
1.0.0.0container-interop aware command-bus
MIT
The Requires
The Development Requires
by Glenn Eggeton
Wallogit.com
2017 © Pedro Peláez
container-interop aware command-bus
Micro-Service Command/Event Framework, (*1)
Commander maps a HTTP Request to a Command Handler and listens for Framework Events., (*2)
1) Write a Command Handler
- Make sure to Fire CompletedEvent
- Make sure to Fire ErrorEvent, (*3)
2) Tell commander what end-point the handler is for, (*4)
3) Do something with your Event, (*5)
Currently we only support JSON APIs., (*6)
$commander = new Commander();
$this->commander->get('/user/{id}', 'user.cache.get', SimpleGetUserHandler::class);
$commander->run();
//In SimpleGetUserHandler
class SimpleGetUserHandler extends Handler
{
/**
* @param CommandInterface $command
*/
public function handle(CommandInterface $command)
{
$this->eventBus->notify(CompletedEvent::makeEvent(['id' => '1'])); //fill in the user info
}
}
You can subscribe to the following Framework Events, (*7)
Framework.Complete, (*8)
User Defined
Framework.Error, (*9)
User Defined or Framework Errors are ["message" => "..."]
Framework.CommandBus.Handle, (*10)
[CommandKey]
Framework.Invoke, (*11)
["commandKey" => "", "commandClass" => ""]
Framework.EventBus.Notify, (*12)
callable... [$object, "method"]
container-interop aware command-bus
MIT
container-interop aware command-bus
MIT