Defines the implementation lifecycle used while replaying a trace.
The implementation value is opaque to Victoria. It may be a value, PID,
database context, client, or any other implementation handle. State zero is
passed to init/1 and verified without being executed. Later steps are
passed to execute/2, then compared through snapshot/1 and
project/1. Optional cleanup/1 runs once after a successful init on
every controlled exit.
Summary
Callbacks
Releases implementation resources after a controlled replay exit.
Executes one non-initial formal step and returns the next implementation handle.
Creates the implementation from the initial formal state.
Returns the expected state supplied by a formal step.
Returns the implementation's observed state.
Types
Callbacks
@callback cleanup(implementation()) :: :ok | {:error, reason()}
Releases implementation resources after a controlled replay exit.
@callback execute(Victoria.Step.t(), implementation()) :: {:ok, implementation()} | {:error, reason()}
Executes one non-initial formal step and returns the next implementation handle.
@callback init(map()) :: {:ok, implementation()} | {:error, reason()}
Creates the implementation from the initial formal state.
@callback project(Victoria.Step.t()) :: map()
Returns the expected state supplied by a formal step.
@callback snapshot(implementation()) :: map()
Returns the implementation's observed state.