Handle returned by attempt(). The caller decides whether the speculative work survives (commit) or is rolled back (discard).
attempt()
Whatever the attempt callback returned (often a Promise).
The AbortSignal passed to the attempt callback. discard() aborts it, so async speculative work wired to it is cancelled.
AbortSignal
discard()
Mark the attempt as committed in history (records a checkpoint).
Replay back to before the attempt (aborting signal); the entries land on forks on the next mutation.
signal
forks
Handle returned by
attempt(). The caller decides whether the speculative work survives (commit) or is rolled back (discard).