acquireLock method

Future<DistributedLock> acquireLock(
  1. String mutex, {
  2. bool exclusive = true,
})

Returns a DistributedLock for the given mutex. The lock can be used to synchronize access to a shared resource. The lock will be released when the release method on the returned object is invoked or whenever the connection with the server is lost.

Implementation

Future<DistributedLock> acquireLock(String mutex, {bool exclusive = true}) {
  _validateNotDestructed(
      exceptionToThrow: LockFailedException('client not connected'));
  return _distributedLockManager.lock(mutex, exclusive);
}