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.
 
 
 
 
 
 

25 lines
874 B

using System;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
namespace Volo.Abp.DistributedLocking;
public interface IAbpDistributedLock
{
/// <summary>
/// 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.
/// </summary>
/// <param name="name">The name of the lock</param>
/// <param name="timeout">How long to wait before giving up on the acquisition attempt. Defaults to 0</param>
/// <param name="cancellationToken">Cancellation token</param>
[ItemCanBeNull]
Task<IAbpDistributedLockHandle> TryAcquireAsync(
[NotNull] string name,
TimeSpan timeout = default,
CancellationToken cancellationToken = default
);
}