| | | 1 | | using Medallion.Threading; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Common.DistributedHosting.DistributedLocks; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Represents a Noop (No-Operation) implementation of the <see cref="IDistributedLock"/> interface. |
| | | 7 | | /// </summary> |
| | | 8 | | public class NoopDistributedLock : IDistributedLock |
| | | 9 | | { |
| | | 10 | | /// <inheritdoc /> |
| | | 11 | | public IDistributedSynchronizationHandle? TryAcquire(TimeSpan timeout = new TimeSpan(), CancellationToken cancellati |
| | | 12 | | { |
| | 0 | 13 | | return new NoopDistributedSynchronizationHandle(); |
| | | 14 | | } |
| | | 15 | | |
| | | 16 | | /// <inheritdoc /> |
| | | 17 | | public IDistributedSynchronizationHandle Acquire(TimeSpan? timeout = null, CancellationToken cancellationToken = new |
| | | 18 | | { |
| | 0 | 19 | | return new NoopDistributedSynchronizationHandle(); |
| | | 20 | | } |
| | | 21 | | |
| | | 22 | | /// <inheritdoc /> |
| | | 23 | | public ValueTask<IDistributedSynchronizationHandle?> TryAcquireAsync(TimeSpan timeout = new TimeSpan(), Cancellation |
| | | 24 | | { |
| | 0 | 25 | | return new ValueTask<IDistributedSynchronizationHandle?>(new NoopDistributedSynchronizationHandle()); |
| | | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <inheritdoc /> |
| | | 29 | | public ValueTask<IDistributedSynchronizationHandle> AcquireAsync(TimeSpan? timeout = null, CancellationToken cancell |
| | | 30 | | { |
| | 0 | 31 | | return new ValueTask<IDistributedSynchronizationHandle>(new NoopDistributedSynchronizationHandle()); |
| | | 32 | | } |
| | | 33 | | |
| | | 34 | | /// <inheritdoc /> |
| | 0 | 35 | | public string Name => "Noop"; |
| | | 36 | | } |