Class PostgreSqlTableLock
The distributed lock based on a PostgreSql table.
Implements
Inherited Members
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
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 |
Overrides
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. |