Summary
Ship a behavior that runs next inside an ambient transaction supplied by the caller: a TransactionScope, or a small unit-of-work the caller implements.
API
The behavior takes a factory that starts the transaction and returns an object the behavior can complete or abandon. TransactionScope is the built-in case. The unit-of-work shape is Complete() plus Dispose().
Behavior
- Start the transaction before
next. Complete it when the attempt succeeds. Dispose it without completing when the attempt throws or the awaitable faults.
- For
Task and ValueTask, complete only after Proceed has observed success.
- Sit inside each retry attempt. A failed attempt rolls back, and the next attempt starts a new transaction. The cache sits inside this transaction.
Acceptance
- A successful call completes the scope once.
- A thrown exception leaves the scope incomplete and disposes it.
- A faulted task does the same.
- A retry gets a new scope on every attempt.
Composition
Outer to inner: observation, resilience, transaction, cache, target.


Summary
Ship a behavior that runs
nextinside an ambient transaction supplied by the caller: aTransactionScope, or a small unit-of-work the caller implements.API
The behavior takes a factory that starts the transaction and returns an object the behavior can complete or abandon.
TransactionScopeis the built-in case. The unit-of-work shape isComplete()plusDispose().Behavior
next. Complete it when the attempt succeeds. Dispose it without completing when the attempt throws or the awaitable faults.TaskandValueTask, complete only afterProceedhas observed success.Acceptance
Composition
Outer to inner: observation, resilience, transaction, cache, target.