pub fn evaluate_state_transition(
from: RunState,
to: RunState,
ctx: KeyLifecycleContext<'_>,
) -> LifecycleResultExpand description
Determines the appropriate key lifecycle action based on a state transition.
When a run transitions to Running, the concurrency key should be acquired. When a run transitions to a terminal state (Completed, Failed, Canceled), the concurrency key should be released.
The hold_policy parameter controls behavior when transitioning from
Running to RetryWait:
ConcurrencyKeyHoldPolicy::HoldDuringRetry: the key is retained (no release) so no other run with the same key can start during retry.ConcurrencyKeyHoldPolicy::ReleaseOnRetry: the key is released, allowing other runs to acquire it while this run waits for retry.