Show / Hide Table of Contents

    Class DistributedLock

    Represents a lock that has been acquired through an IDistributedLockManager.

    Inheritance
    object
    DistributedLock
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Background
    Assembly: Silverback.Core.dll
    Syntax
    public class DistributedLock

    Constructors

    | Improve this doc View source

    DistributedLock(DistributedLockSettings, IDistributedLockManager)

    Initializes a new instance of the DistributedLock class.

    Declaration
    public DistributedLock(DistributedLockSettings settings, IDistributedLockManager lockManager)
    Parameters
    Type Name Description
    DistributedLockSettings settings

    Specifies all settings of the lock to be acquired.

    IDistributedLockManager lockManager

    The IDistributedLockManager that generated the lock and can be used to keep it alive and finally release it.

    Properties

    | Improve this doc View source

    Status

    Gets the lock status.

    Declaration
    public DistributedLockStatus Status { get; }
    Property Value
    Type Description
    DistributedLockStatus

    Methods

    | Improve this doc View source

    ReleaseAsync()

    Releases the lock.

    Declaration
    public Task ReleaseAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    RenewAsync(CancellationToken)

    Ensures that the lock is still valid, otherwise tries to re-acquire it.

    Declaration
    public Task RenewAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A CancellationToken to observe while waiting for the task to complete.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini