acquireWrite method

Future<LockGrant> acquireWrite(
  1. String table, {
  2. int timeoutMs = 5000,
})

Acquire an exclusive (write) lock on table.

Grants immediately if the lock is completely free. Otherwise enqueues a write waiter in FIFO order.

Implementation

Future<LockGrant> acquireWrite(String table, {int timeoutMs = 5000}) async {
  await _lockFor(table).acquireWrite(timeoutMs: timeoutMs);
  return LockGrant(table, LockMode.write);
}