Show / Hide Table of Contents

    Class InMemoryLock

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

    Inheritance
    object
    DistributedLock
    InMemoryLock
    Implements
    IDistributedLock
    IDisposable
    Inherited Members
    DistributedLock.AcquireAsync(CancellationToken)
    object.GetType()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    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
    DistributedLock.AcquireCoreAsync(CancellationToken)

    Dispose()

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

    Declaration
    public void Dispose()

    Implements

    IDistributedLock
    IDisposable
    GitHub E-Mail
    ↑ Back to top © 2026 Sergio Aquilini