-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
The Command Bus:
Given an instance of a CommandHandlerResolver, it should be able to dispatch the command to the Handler.
Like so:
// An array of commands with handlers.
$commandsWithHandlers = [
Domain\Command\DoSometing::class =>
Domain\Hanlder\DoSomething::class,
Domain\Command\DoSomethingElse::class =>
Domain\Handler\DoSomethingElse::class,
];
$commandBus = new \SwellPhp\Admiral\CommandBus(
new \SwellPhp\Admiral\ArrayResolver($commandsWithHandlers)
);
// Instantiates the command.
$command = new \Domain\Command\DoSometing(
'some',
'parameters'
);
// Dispath a command and it will be handled in the backgound.
$commandBus->dispatch($command)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request