Show / Hide Table of Contents

    Class PostgreSqlTableLock

    The distributed lock based on a PostgreSql table.

    Inheritance
    object
    DistributedLock
    TableBasedDistributedLock
    PostgreSqlTableLock
    Implements
    IDistributedLock
    Inherited Members
    TableBasedDistributedLock.AcquireCoreAsync(CancellationToken)
    DistributedLock.AcquireAsync(CancellationToken)
    object.GetType()
    object.MemberwiseClone()
    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 class PostgreSqlTableLock : TableBasedDistributedLock, IDistributedLock

    Constructors

    PostgreSqlTableLock(PostgreSqlTableLockSettings, ISilverbackLogger<PostgreSqlTableLock>)

    Initializes a new instance of the PostgreSqlTableLock class.

    Declaration
    public PostgreSqlTableLock(PostgreSqlTableLockSettings settings, ISilverbackLogger<PostgreSqlTableLock> logger)
    Parameters
    Type Name Description
    PostgreSqlTableLockSettings settings

    The lock settings.

    ISilverbackLogger<PostgreSqlTableLock> logger

    The logger.

    Methods

    ReleaseLockAsync(string)

    Releases the lock.

    Declaration
    protected override Task ReleaseLockAsync(string handlerName)
    Parameters
    Type Name Description
    string handlerName

    The name of the current handler.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    TableBasedDistributedLock.ReleaseLockAsync(string)

    TryAcquireLockAsync(string)

    Tries to acquire the lock.

    Declaration
    protected override Task<bool> TryAcquireLockAsync(string handlerName)
    Parameters
    Type Name Description
    string handlerName

    The name of the current handler.

    Returns
    Type Description
    Task<bool>

    A Task representing the asynchronous operation. The result is true if the lock was acquired, otherwise false.

    Overrides
    TableBasedDistributedLock.TryAcquireLockAsync(string)

    UpdateHeartbeatAsync(string)

    Updates the last heartbeat of the lock.

    Declaration
    protected override Task UpdateHeartbeatAsync(string handlerName)
    Parameters
    Type Name Description
    string handlerName

    The name of the current handler.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    TableBasedDistributedLock.UpdateHeartbeatAsync(string)

    Implements

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