Class InMemoryLock
This implementation of DistributedLock is not really distributed and is meant for testing purposes only.
Inherited Members
Namespace: Silverback.Lock
Assembly: Silverback.Storage.Memory.dll
Syntax
public sealed class InMemoryLock : DistributedLock, IDistributedLock, IDisposable
Constructors
InMemoryLock(DistributedLockSettings, ISilverbackLogger<InMemoryLock>)
Initializes a new instance of the InMemoryLock class.
Declaration
public InMemoryLock(DistributedLockSettings settings, ISilverbackLogger<InMemoryLock> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| DistributedLockSettings | settings | The lock settings. |
| ISilverbackLogger<InMemoryLock> | logger | The logger. |
Methods
AcquireCoreAsync(CancellationToken)
Acquires the lock.
Declaration
protected override ValueTask<DistributedLockHandle> AcquireCoreAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | A CancellationToken used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| ValueTask<DistributedLockHandle> | A Task representing the asynchronous operation. |
Overrides
Dispose()
This implementation of DistributedLock is not really distributed and is meant for testing purposes only.
Declaration
public void Dispose()