evoq_pm_instance (evoq v1.14.1)
View SourceProcess manager instance GenServer.
Represents a single running instance of a process manager (saga). Each instance: - Has a unique process ID (correlation ID) - Maintains its own state - Handles events and dispatches commands - Supports saga compensation on failures
Summary
Functions
Trigger compensation for a failed command.
Get the current state.
Handle an event.
Start a PM instance.
Functions
-spec compensate(pid(), #evoq_command{command_id :: binary() | undefined, command_type :: atom() | undefined, aggregate_type :: atom() | undefined, aggregate_id :: binary() | undefined, payload :: map(), metadata :: map(), causation_id :: binary() | undefined, correlation_id :: binary() | undefined, idempotency_key :: binary() | undefined}) -> {ok, [#evoq_command{command_id :: binary() | undefined, command_type :: atom() | undefined, aggregate_type :: atom() | undefined, aggregate_id :: binary() | undefined, payload :: map(), metadata :: map(), causation_id :: binary() | undefined, correlation_id :: binary() | undefined, idempotency_key :: binary() | undefined}]} | skip.
Trigger compensation for a failed command.
Get the current state.
Handle an event.
Start a PM instance.