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)

Link to this section Summary

Link to this section Functions

Link to this macro

router(router_module)

View Source (macro)