Show / Hide Table of Contents

    Class NullLockManager

    This implementation of IDistributedLockManager doesn't actually acquire nor check any lock. Is is used when the NullLockSettings are specified or no other IDistributedLockManager is registered.

    Inheritance
    object
    NullLockManager
    Implements
    IDistributedLockManager
    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 NullLockManager : IDistributedLockManager

    Methods

    | Improve this doc View source

    AcquireAsync(DistributedLockSettings, CancellationToken)

    Acquires a new lock on the specified resource.

    Declaration
    public Task<DistributedLock?> AcquireAsync(DistributedLockSettings settings, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    DistributedLockSettings settings

    Specifies all settings of the lock to be acquired.

    CancellationToken cancellationToken

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

    Returns
    Type Description
    Task<DistributedLock>

    A Task<TResult> representing the asynchronous operation. The task result contains the acquired DistributedLock (or null if no lock was actually acquired).

    | Improve this doc View source

    CheckIsStillLockedAsync(DistributedLockSettings)

    Returns a boolean value indicating whether the specified lock is taken already.

    Declaration
    public Task<bool> CheckIsStillLockedAsync(DistributedLockSettings settings)
    Parameters
    Type Name Description
    DistributedLockSettings settings

    Specifies the lock to be checked.

    Returns
    Type Description
    Task<bool>

    A Task<TResult> representing the asynchronous operation. The task result contains a boolean value indicating whether the lock is taken.

    | Improve this doc View source

    ReleaseAsync(DistributedLockSettings)

    Releases the lock.

    Declaration
    public Task ReleaseAsync(DistributedLockSettings settings)
    Parameters
    Type Name Description
    DistributedLockSettings settings

    Specifies the lock to be released.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    SendHeartbeatAsync(DistributedLockSettings)

    Called periodically after the lock has been acquired to send an heartbeat that keeps the lock.

    Declaration
    public Task<bool> SendHeartbeatAsync(DistributedLockSettings settings)
    Parameters
    Type Name Description
    DistributedLockSettings settings

    Specifies the lock to be refreshed.

    Returns
    Type Description
    Task<bool>

    A Task<TResult> representing the asynchronous operation. The task result contains a boolean value indicating whether the lock could be refreshed.

    Implements

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