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
    bool

    Methods

    View Source

    ReadLock(int, TimeSpan?)

    Obtains a distributed read lock.

    Declaration
    IDistributedLock ReadLock(int lockId, TimeSpan? obtainLockTimeout = null)
    Parameters
    Type Name Description
    int lockId
    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(int, TimeSpan?)

    Obtains a distributed read lock.

    Declaration
    IDistributedLock WriteLock(int lockId, TimeSpan? obtainLockTimeout = null)
    Parameters
    Type Name Description
    int lockId
    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.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX