Show / Hide Table of Contents

    Class DistributedLock

    The base class for all distributed locks.

    Inheritance
    object
    DistributedLock
    InMemoryLock
    PostgreSqlAdvisoryLock
    TableBasedDistributedLock
    Implements
    IDistributedLock
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Silverback.Lock
    Assembly: Silverback.Core.dll
    Syntax
    public abstract class DistributedLock : IDistributedLock

    Constructors

    DistributedLock()

    The base class for all distributed locks.

    Declaration
    protected DistributedLock()

    Methods

    AcquireAsync(CancellationToken)

    Acquires the lock.

    Declaration
    public ValueTask<DistributedLockHandle> AcquireAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A CancellationToken used to cancel the operation.

    Returns
    Type Description
    ValueTask<DistributedLockHandle>

    A Task representing the asynchronous operation.

    AcquireCoreAsync(CancellationToken)

    Acquires the lock.

    Declaration
    protected abstract 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.

    Implements

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