Performs specified action on lock associated with dashboard type and user.
If lock cannot be acquired within a short time because another task is running concurrently on the lock, method throws an exception InvalidOperationException.
The lock is released even if specified method threw an exception, after which exception is thrown outside.
Task<T> ExecuteInLockAsync<T>(
Guid userID,
DashboardType dashboardType,
Func<IDbScope, CancellationToken, Task<T>> actionAsync,
CancellationToken cancellationToken = default
)
Function ExecuteInLockAsync(Of T) (
userID As Guid,
dashboardType As DashboardType,
actionAsync As Func(Of IDbScope, CancellationToken, Task(Of T)),
Optional cancellationToken As CancellationToken = Nothing
) As Task(Of T)generic<typename T>
Task<T>^ ExecuteInLockAsync(
Guid userID,
DashboardType dashboardType,
Func<IDbScope^, CancellationToken, Task<T>^>^ actionAsync,
CancellationToken cancellationToken = CancellationToken()
)abstract ExecuteInLockAsync :
userID : Guid *
dashboardType : DashboardType *
actionAsync : Func<IDbScope, CancellationToken, Task<'T>> *
?cancellationToken : CancellationToken
(* Defaults:
let _cancellationToken = defaultArg cancellationToken new CancellationToken()
*)
-> Task<'T>