Table of Contents

Class InMemoryLock

Namespace
Silverback.Lock
Assembly
Silverback.Storage.Memory.dll

This implementation of DistributedLock is not really distributed and is meant for testing purposes only.

public sealed class InMemoryLock : DistributedLock, IDistributedLock, IDisposable
Inheritance
InMemoryLock
Implements
Inherited Members

Constructors

InMemoryLock(DistributedLockSettings, ISilverbackLogger<InMemoryLock>)

Initializes a new instance of the InMemoryLock class.

public InMemoryLock(DistributedLockSettings settings, ISilverbackLogger<InMemoryLock> logger)

Parameters

settings DistributedLockSettings

The lock settings.

logger ISilverbackLogger<InMemoryLock>

The logger.

Methods

AcquireCoreAsync(CancellationToken)

Acquires the lock.

protected override ValueTask<DistributedLockHandle> AcquireCoreAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

A CancellationToken used to cancel the operation.

Returns

ValueTask<DistributedLockHandle>

A Task representing the asynchronous operation.

Dispose()

public void Dispose()