Current section

Files

Jump to
commanded lib commanded aggregates default_lifespan.ex
Raw

lib/commanded/aggregates/default_lifespan.ex

defmodule Commanded.Aggregates.DefaultLifespan do
@moduledoc """
The default implementation of the `Commanded.Aggregates.AggregateLifespan`
behaviour.
It will ensure that an aggregate instance process runs indefinitely once
started.
"""
@behaviour Commanded.Aggregates.AggregateLifespan
@doc """
Aggregate will run indefinitely once started.
"""
def after_event(_event), do: :infinity
@doc """
Aggregate will run indefinitely once started.
"""
def after_command(_command), do: :infinity
@doc """
Aggregate will run indefinitely once started.
"""
def after_error(_error), do: :infinity
end