Dispatches a command to its registered handler.
The command to dispatch
The result from the command handler
Checks if a handler is registered for a command type.
The command class constructor
True if a handler is registered
Unregisters a command handler.
The command class constructor
True if a handler was unregistered
Clears all registered handlers.
In-memory command bus implementation.
Provides a simple, synchronous command bus for handling commands. Each command type can have only one handler.
Example