transaction<R> method

  1. @override
Future<R> transaction<R>(
  1. Future<R> body(
    1. KeyStoreTxn<String, AtNotification, dynamic> txn
    )
)
override

Run body as a transaction. Mutations performed via the supplied handle are buffered in memory and applied in body order on successful completion; if the body throws, the buffer is dropped and the exception propagates.

Hive impls provide best-effort atomicity; a future SQL impl will provide true atomicity.

Implementation

@override
Future<R> transaction<R>(
    Future<R> Function(KeyStoreTxn<String, AtNotification, dynamic> txn)
        body) async {
  // Notifications are appended one-at-a-time in practice; a minimal
  // buffered transaction keeps the contract without a bespoke handle.
  throw UnsupportedError(
      'transaction() is not used on the notification keystore');
}