Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

17 lines
682 B

using System;
using System.Threading;
using System.Threading.Tasks;
namespace Volo.Abp.DistributedLocking;
/// <summary>
/// This implementation of <see cref="IAbpDistributedLock"/> does not provide any distributed locking functionality.
/// Useful in scenarios where distributed locking is not required or during testing.
/// </summary>
public class NullAbpDistributedLock : IAbpDistributedLock
{
public Task<IAbpDistributedLockHandle?> TryAcquireAsync(string name, TimeSpan timeout = default, CancellationToken cancellationToken = default)
{
return Task.FromResult<IAbpDistributedLockHandle?>(new LocalAbpDistributedLockHandle(NullDisposable.Instance));
}
}