IDashboardLockingStrategyExecuteInLockAsyncT - метод

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.

Definition

Пространство имён: Tessa.Dashboards
Сборка: Tessa (в Tessa.dll) Версия: 4.1.3+7e2b1422f9b8c7c41fbbc4b151a843bed05319ab
C#
Task<T> ExecuteInLockAsync<T>(
	Guid userID,
	DashboardType dashboardType,
	Func<IDbScope, CancellationToken, Task<T>> actionAsync,
	CancellationToken cancellationToken = default
)

Параметры

userID  Guid
User ID.
dashboardType  DashboardType
Dashboard types.
actionAsync  FuncIDbScope, CancellationToken, TaskT
Action performed in lock. The parameter receives object providing access to the database. The parameter must not be equal to . The result of the action will be of type T.
cancellationToken  CancellationToken  (Optional)
Propagates notification that operations should be canceled.

Параметры типа

T
The type of the result returned by the actionAsync.

Возвращаемое значение

TaskT
Asynchronous task that returns the result of the action of type T.

См. также