Class DistributedLock
The base class for all distributed locks.
Implements
Inherited Members
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. |