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?, TimeSpan?, TimeSpan?, TimeSpan?, 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 |
---|---|---|
string | resourceName | The name of the lock / the resource being locked. |
string | uniqueId | A unique identifier representing the entity trying to acquire the lock. Th default is a new Guid. |
TimeSpan? | acquireTimeout | After the acquire timeout is expired the lock manager will abort the lock acquisition. The default is no timeout. |
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. |
TimeSpan? | heartbeatTimeout | After the heartbeat timeout is expired the lock will be considered released. The default is 1 minute. |
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 |
---|---|
TimeSpan |
AcquireTimeout
Gets the timeout after which the lock manager will abort the lock acquisition.
Declaration
public TimeSpan? AcquireTimeout { get; }
Property Value
Type | Description |
---|---|
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 |
---|---|
int |
HeartbeatInterval
Gets the interval at which the heartbeat has to be sent.
Declaration
public TimeSpan HeartbeatInterval { get; }
Property Value
Type | Description |
---|---|
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 |
---|---|
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 |
---|---|
string |
UniqueId
Gets a unique identifier representing the entity trying to acquire the lock.
Declaration
public string UniqueId { get; }
Property Value
Type | Description |
---|---|
string |