Show / Hide Table of Contents

    Class PostgreSqlAdvisoryLock

    The distributed lock based on PostgreSql Advisory locks.

    Inheritance
    object
    DistributedLock
    PostgreSqlAdvisoryLock
    Implements
    IDistributedLock
    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.PostgreSql.dll
    Syntax
    public sealed class PostgreSqlAdvisoryLock : DistributedLock, IDistributedLock

    Constructors

    PostgreSqlAdvisoryLock(PostgreSqlAdvisoryLockSettings, ISilverbackLogger<PostgreSqlAdvisoryLock>)

    Initializes a new instance of the PostgreSqlAdvisoryLock class.

    Declaration
    public PostgreSqlAdvisoryLock(PostgreSqlAdvisoryLockSettings settings, ISilverbackLogger<PostgreSqlAdvisoryLock> logger)
    Parameters
    Type Name Description
    PostgreSqlAdvisoryLockSettings settings

    The lock settings.

    ISilverbackLogger<PostgreSqlAdvisoryLock> 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)

    Implements

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