Interface IDistributedLock
- Namespace
- Integrations.Application.Common
- Assembly
- Integrations.Application.dll
Cluster-wide mutual exclusion (scheduled jobs, rate imports) across replicas.
public interface IDistributedLock
Methods
AcquireAsync(string, CancellationToken)
Waits until the lock is free, then holds it until the handle is disposed.
Task<IAsyncDisposable> AcquireAsync(string name, CancellationToken cancellationToken)
Parameters
namestringcancellationTokenCancellationToken
Returns
TryAcquireAsync(string, CancellationToken)
Returns a handle when the lock was acquired, or null when another replica holds it.
Task<IAsyncDisposable?> TryAcquireAsync(string name, CancellationToken cancellationToken)
Parameters
namestringcancellationTokenCancellationToken