using System; using System.Threading; using System.Threading.Tasks; using JetBrains.Annotations; namespace Volo.Abp.DistributedLocking; public interface IAbpDistributedLock { /// /// Tries to acquire a named lock. /// Returns a disposable object to release the lock. /// It is suggested to use this method within a using block. /// Returns null if the lock could not be handled. /// /// The name of the lock /// How long to wait before giving up on the acquisition attempt. Defaults to 0 /// Cancellation token Task TryAcquireAsync( [NotNull] string name, TimeSpan timeout = default, CancellationToken cancellationToken = default ); }