Commanded v0.16.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
:ok = ExampleCompositeRouter.dispatch(%OpenAccount{account_number: "ACC123", initial_balance: 1_000})