CommandedAggregateless. Command. Router
(commanded_aggregateless v1.0.0)
Copy Markdown
Provides basic DSQL for registering commands with the Commanded.Commands.Router
This sets up a consistent convention that dispatches commands to an aggregate-per-command.
Summary
Functions
Configure the module to be able to register commands
Register a command with the Commanded.Commands.Router
Functions
Configure the module to be able to register commands
Register a command with the Commanded.Commands.Router
Options:
:aggregate- the aggregate module to dispatch the command to. Defaults to the command module's Aggregate module (e.g. MyCommand.Aggregate):aggregate_identifier- the aggregate identifier. This is a keyword list withbyandprefixkeys. Defaults to the value returned by the aggregate module'sidentifier/0function function.:lifespan- the lifespan module to user with this command. Defaults toCommandedAggregateless.Command.DefaultLifespan:timeout- the timeout for the command. Defaults to 5_000ms.
Examples:
register_command(MyCommand)
register_command(
MyCommand,
aggregate: MyAggregate,
aggregate_identifier: [by: :id, prefix: "my_aggregate"],
lifespan: MyLifespan,
timeout: 10_000
)