Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IDistributedLockingMechanism

    Represents a class responsible for managing distributed locks.

    Namespace: Umbraco.Cms.Core.DistributedLocking
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IDistributedLockingMechanism
    Remarks

    In general the rules for distributed locks are as follows.

    • Cannot obtain a write lock if a read lock exists for same lock id (except during an upgrade from reader -> writer)
    • Cannot obtain a write lock if a write lock exists for same lock id.
    • Cannot obtain a read lock if a write lock exists for same lock id.
    • Can obtain a read lock if a read lock exists for same lock id.

    Properties

    View Source

    Enabled

    Gets a value indicating whether this distributed locking mechanism can be used.

    Declaration
    bool Enabled { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    View Source

    ReadLock(Int32, Nullable<TimeSpan>)

    Obtains a distributed read lock.

    Declaration
    IDistributedLock ReadLock(int lockId, TimeSpan? obtainLockTimeout = null)
    Parameters
    Type Name Description
    System.Int32 lockId
    System.Nullable<TimeSpan> obtainLockTimeout
    Returns
    Type Description
    IDistributedLock
    Remarks

    When timeout is null, implementations should use DistributedLockingReadLockDefaultTimeout.

    Exceptions
    Type Condition
    DistributedReadLockTimeoutException

    Failed to obtain distributed read lock in time.

    View Source

    WriteLock(Int32, Nullable<TimeSpan>)

    Obtains a distributed read lock.

    Declaration
    IDistributedLock WriteLock(int lockId, TimeSpan? obtainLockTimeout = null)
    Parameters
    Type Name Description
    System.Int32 lockId
    System.Nullable<TimeSpan> obtainLockTimeout
    Returns
    Type Description
    IDistributedLock
    Remarks

    When timeout is null, implementations should use DistributedLockingWriteLockDefaultTimeout.

    Exceptions
    Type Condition
    DistributedWriteLockTimeoutException

    Failed to obtain distributed write lock in time.

    • Improve this Doc
    • View Source
    In This Article
    • Properties
      • Enabled
    • Methods
      • ReadLock(Int32, Nullable<TimeSpan>)
      • WriteLock(Int32, Nullable<TimeSpan>)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX