transaction<R> method

Future<R> transaction<R>(
  1. Future<R> action()
)

Executes a block of code within a single atomic transaction.

This is crucial for multi-step processes where all steps must succeed or fail together. This mainly delegates to the local adapter.

Implementation

Future<R> transaction<R>(Future<R> Function() action) {
  _ensureInitialized();
  return localAdapter.transaction(action);
}