Class DistributedLockSettings
The settings to be applied to the configured IDistributedLockManager.
Inherited Members
Namespace: Silverback.Background
Assembly: Silverback.Core.dll
Syntax
public class DistributedLockSettings
Constructors
| Improve this doc View sourceDistributedLockSettings(String, String, Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>)
Initializes a new instance of the DistributedLockSettings class.
Declaration
public DistributedLockSettings(string resourceName = "", string uniqueId = null, TimeSpan? acquireTimeout = null, TimeSpan? acquireRetryInterval = null, TimeSpan? heartbeatTimeout = null, TimeSpan? heartbeatInterval = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | resourceName | The name of the lock / the resource being locked. |
System.String | uniqueId | A unique identifier representing the entity trying to acquire the lock. Th default is a new System.Guid. |
System.Nullable<System.TimeSpan> | acquireTimeout | After the acquire timeout is expired the lock manager will abort the lock acquisition. The default is no timeout. |
System.Nullable<System.TimeSpan> | acquireRetryInterval | The interval at which the lock manager checks if a lock can be acquired for the specified resource. The default is 30 seconds. |
System.Nullable<System.TimeSpan> | heartbeatTimeout | After the heartbeat timeout is expired the lock will be considered released. The default is 1 minute. |
System.Nullable<System.TimeSpan> | heartbeatInterval | The interval at which the heartbeat has to be sent. The default is 1 second. |
Properties
| Improve this doc View sourceAcquireRetryInterval
Gets the interval at which the lock manager checks if a lock can be acquired for the specified resource.
Declaration
public TimeSpan AcquireRetryInterval { get; }
Property Value
Type | Description |
---|---|
System.TimeSpan |
AcquireTimeout
Gets the timeout after which the lock manager will abort the lock acquisition.
Declaration
public TimeSpan? AcquireTimeout { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.TimeSpan> |
FailedHeartbeatsThreshold
Gets the maximum number of heartbeats that can be failed to be sent before stopping.
Declaration
public int FailedHeartbeatsThreshold { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
HeartbeatInterval
Gets the interval at which the heartbeat has to be sent.
Declaration
public TimeSpan HeartbeatInterval { get; }
Property Value
Type | Description |
---|---|
System.TimeSpan |
HeartbeatTimeout
Gets the timeout after which the lock will be considered released if no heartbeat is sent.
Declaration
public TimeSpan HeartbeatTimeout { get; }
Property Value
Type | Description |
---|---|
System.TimeSpan |
NoLock
Gets the DistributedLockSettings signaling that no lock is to be checked and acquired. Corresponds to an instance of NullLockSettings.
Declaration
public static DistributedLockSettings NoLock { get; }
Property Value
Type | Description |
---|---|
DistributedLockSettings |
ResourceName
Gets the name of the lock / the resource being locked.
Declaration
public string ResourceName { get; }
Property Value
Type | Description |
---|---|
System.String |
UniqueId
Gets a unique identifier representing the entity trying to acquire the lock.
Declaration
public string UniqueId { get; }
Property Value
Type | Description |
---|---|
System.String |