Commanded v0.19.1 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})

Link to this section Summary

Link to this section Functions

Link to this macro

router(router_module)

View Source (macro)