Commanded v1.0.0 Commanded.Commands.CompositeRouter View Source
Composite router allows you to combine multiple router modules into a single router able to dispatch any registered command using its corresponding router.
Example
defmodule ExampleCompositeRouter do
use Commanded.Commands.CompositeRouter
router BankAccountRouter
router MoneyTransferRouter
end
command = %OpenAccount{account_number: "ACC123", initial_balance: 1_000}
:ok = ExampleCompositeRouter.dispatch(command)