Skip to main content

Class TaskuraiDistributedLock

Class to manage Taskurai distributed lock the Taskurai.TaskuraiDistributedLock.

Assembly: Taskurai.dll
Declaration
public class TaskuraiDistributedLock : IDisposable

Implements:
System.IDisposable

Properties

Lock

Declaration
public LockResponse Lock { get; }

Methods

ReleaseLock()

Release a distributed lock.

Declaration
public bool ReleaseLock()
Returns

System.Boolean: Returns true if lock is unlocked or not found.### ReleaseLockAsync() Release a distributed lock.

Declaration
public Task<bool> ReleaseLockAsync()
Returns

System.Threading.Tasks.Task<System.Boolean>: Returns true if lock is unlocked or not found.### ThrowIfLockExpired() Throws if lock is expired.

Declaration
public void ThrowIfLockExpired()

IsLocked()

Check if lock lease is still available.

Declaration
public bool IsLocked()
Returns

System.Boolean: Returns true if lock lease is still available.### IsLockedAsync() Check if lock lease is still available.

Declaration
public Task<bool> IsLockedAsync()
Returns

System.Threading.Tasks.Task<System.Boolean>: Returns true if lock lease is still available.### Dispose()

Declaration
public void Dispose()

DisposeAsync()

Declaration
public Task DisposeAsync()
Returns

System.Threading.Tasks.Task

Implements

  • System.IDisposable