Interface ILockManager
Defines operations of distributed lock manager
Namespace: Azos.Sky.Locking
Assembly: Azos.Sky.dll
Syntax
public interface ILockManager
Properties
Item[LockSessionID]
Returns the session by id or null
Declaration
LockSession this[LockSessionID sid] { get; }
Parameters
Type | Name | Description |
---|---|---|
LockSessionID | sid |
Property Value
Type | Description |
---|---|
LockSession |
Methods
EndLockSession(LockSession)
Ends the remote lock session returning true if it was found remotely and destroyed
Declaration
bool EndLockSession(LockSession session)
Parameters
Type | Name | Description |
---|---|---|
LockSession | session |
Returns
Type | Description |
---|---|
System.Boolean |
EndLockSessionAsync(LockSession)
Ends the remote lock session returning true if it was found remotely and destroyed
Declaration
Task<bool> EndLockSessionAsync(LockSession session)
Parameters
Type | Name | Description |
---|---|---|
LockSession | session |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> |
ExecuteLockTransaction(LockSession, LockTransaction)
Executes a lock transaction in the secified session returning transaction result object even if lock could not be set. The exception would indicate inability to deliver the transaction request to the server or other system problem
Declaration
LockTransactionResult ExecuteLockTransaction(LockSession session, LockTransaction transaction)
Parameters
Type | Name | Description |
---|---|---|
LockSession | session | |
LockTransaction | transaction |
Returns
Type | Description |
---|---|
LockTransactionResult |
ExecuteLockTransactionAsync(LockSession, LockTransaction)
Executes a lock transaction in the secified session returning transaction result object even if lock could not be set. The exception would indicate inability to deliver the transaction request to the server or other system problem
Declaration
Task<LockTransactionResult> ExecuteLockTransactionAsync(LockSession session, LockTransaction transaction)
Parameters
Type | Name | Description |
---|---|---|
LockSession | session | |
LockTransaction | transaction |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<LockTransactionResult> |
MakeSession(String, Object, String, Nullable<Int32>)
Creates a session of work with lock server at the specified path level and sharding id
Declaration
LockSession MakeSession(string path, object shardingID, string description = null, int? maxAgeSec = default(int? ))
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The level of the that has to be covered by the lock, the zone governors are looked up at that or higher level |
System.Object | shardingID | The object used for work partitioning. Keep in mind that ALL logically-connected lock entities must use the same shardingID |
System.String | description | Logical description of the session |
System.Nullable<System.Int32> | maxAgeSec | The maximum session age in seconds, or null for default |
Returns
Type | Description |
---|---|
LockSession | New lock session registered with the manager. The session instance may be later looked-up by LockSessionID |