withWrite<T> method

Future<T> withWrite<T>(
  1. String table,
  2. Future<T> fn()
)

Implementation

Future<T> withWrite<T>(String table, Future<T> Function() fn) async {
  final grant = await acquireWrite(table);
  try {
    return await fn();
  } finally {
    release(grant);
  }
}