public static async Task AcquireAsync(this IDistributedAsyncLock mutexLock, int millisecondsTimeout)
        {
            var locked = await mutexLock.TryAcquireAsync(millisecondsTimeout);

            if (!locked)
            {
                throw new TimeoutException("Acquire lock timeout");
            }
        }
 public static Task <bool> TryAcquireAsync(this IDistributedAsyncLock mutexLock, TimeSpan timeout)
 {
     return(mutexLock.TryAcquireAsync((int)timeout.TotalMilliseconds));
 }
 public static Task TryAcquireAsync(this IDistributedAsyncLock mutexLock)
 {
     return(mutexLock.TryAcquireAsync(0));
 }