View Source OnePiece.Commanded.Aggregate.StatelessLifespan (OnePiece.Commanded v0.21.4)

Stops the aggregate after a command, event or error.

Summary

Functions

Stops the aggregate after a command.

Stops the aggregate after an error.

Stops the aggregate after an event.

Functions

after_command(command)

Stops the aggregate after a command.

iex> OnePiece.Commanded.Aggregate.StatelessLifespan.after_command(%MyCommandOne{})
:stop

after_error(error)

Stops the aggregate after an error.

iex> OnePiece.Commanded.Aggregate.StatelessLifespan.after_error({:error, :something_happened})
:stop

after_event(event)

Stops the aggregate after an event.

iex> OnePiece.Commanded.Aggregate.StatelessLifespan.after_event(%DepositAccountOpened{})
:stop