evoq_aggregate_lifespan_default (evoq v1.14.1)
View SourceDefault aggregate lifespan implementation.
Provides sensible defaults for aggregate lifecycle: - 30-minute idle timeout - 5-minute timeout on errors - Automatic snapshot on passivation
This prevents the memory explosion that occurs when aggregates live indefinitely (as in Commanded's default lifespan).
Summary
Functions
Return timeout after processing a command. Resets the idle timer to the default 30 minutes.
Return timeout after an error. Uses a shorter timeout (5 minutes) to allow faster recovery.
Return timeout after processing an event. Resets the idle timer to the default 30 minutes.
Return snapshot data on passivation.
Handle timeout by passivating with snapshot.
Functions
-spec after_command(map()) -> evoq_aggregate_lifespan:action().
Return timeout after processing a command. Resets the idle timer to the default 30 minutes.
-spec after_error(term()) -> evoq_aggregate_lifespan:action().
Return timeout after an error. Uses a shorter timeout (5 minutes) to allow faster recovery.
-spec after_event(map()) -> evoq_aggregate_lifespan:action().
Return timeout after processing an event. Resets the idle timer to the default 30 minutes.
Return snapshot data on passivation.
-spec on_timeout(term()) -> {snapshot, passivate}.
Handle timeout by passivating with snapshot.