Class AbortAwareMutator
java.lang.Object
com.google.genkit.ai.agent.internal.AbortAwareMutator
Wraps a
SnapshotMutator so that it returns null (no-op) when the current row is
already SnapshotStatus.ABORTED, preventing a completed or failed write from clobbering a
concurrent abort.
Usage: pass AbortAwareMutator.wrap(inner) to SessionStore.saveSnapshot(...)
instead of the bare inner mutator.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S> SnapshotMutator<S> wrap(SnapshotMutator<S> inner) Wrapsinnerso that it returnsnullwhen the existing snapshot has statusSnapshotStatus.ABORTED; otherwise delegates toinner.
-
Method Details
-
wrap
Wrapsinnerso that it returnsnullwhen the existing snapshot has statusSnapshotStatus.ABORTED; otherwise delegates toinner.- Type Parameters:
S- the type of custom session state- Parameters:
inner- the underlying mutator to wrap- Returns:
- a new mutator that is abort-aware
-