Share via


AccessControlExtensions.ExecuteUnderLockWithRetry Method

Definition

Overloads

ExecuteUnderLockWithRetry<T>(IAssetsAccessContext, Func<CancellationToken,Task<T>>, IEnumerable<String>, AssetsLockScope, CancellationToken)

Execute action wilt lock yield and retry;

ExecuteUnderLockWithRetry<T>(IAssetsAccessContext, Func<CancellationToken,Task<T>>, String, AssetsLockScope, CancellationToken)

Execute action wilt lock yield and retry;

ExecuteUnderLockWithRetry<T>(IAssetsAccessContext, Func<CancellationToken,Task<T>>, IEnumerable<String>, AssetsLockScope, CancellationToken)

Execute action wilt lock yield and retry;

public static System.Threading.Tasks.Task<T> ExecuteUnderLockWithRetry<T> (this Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessContext context, Func<System.Threading.CancellationToken,System.Threading.Tasks.Task<T>> asyncAction, System.Collections.Generic.IEnumerable<string> filePaths, Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope lockScope = Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope.Item, System.Threading.CancellationToken cancel = default);
static member ExecuteUnderLockWithRetry : Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessContext * Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<'T>> * seq<string> * Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
<Extension()>
Public Function ExecuteUnderLockWithRetry(Of T) (context As IAssetsAccessContext, asyncAction As Func(Of CancellationToken, Task(Of T)), filePaths As IEnumerable(Of String), Optional lockScope As AssetsLockScope = Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope.Item, Optional cancel As CancellationToken = Nothing) As Task(Of T)

Type Parameters

T

result type

Parameters

context
IAssetsAccessContext

lock context

asyncAction
Func<CancellationToken,Task<T>>

action to execute

filePaths
IEnumerable<String>

resources to lock

lockScope
AssetsLockScope

lock scope

cancel
CancellationToken

cancellation token

Returns

Task<T>

action result

Applies to

ExecuteUnderLockWithRetry<T>(IAssetsAccessContext, Func<CancellationToken,Task<T>>, String, AssetsLockScope, CancellationToken)

Execute action wilt lock yield and retry;

public static System.Threading.Tasks.Task<T> ExecuteUnderLockWithRetry<T> (this Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessContext context, Func<System.Threading.CancellationToken,System.Threading.Tasks.Task<T>> asyncAction, string filePath, Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope lockScope = Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope.Item, System.Threading.CancellationToken cancel = default);
static member ExecuteUnderLockWithRetry : Microsoft.VisualStudio.Workspace.AssetsControl.IAssetsAccessContext * Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<'T>> * string * Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
<Extension()>
Public Function ExecuteUnderLockWithRetry(Of T) (context As IAssetsAccessContext, asyncAction As Func(Of CancellationToken, Task(Of T)), filePath As String, Optional lockScope As AssetsLockScope = Microsoft.VisualStudio.Workspace.AssetsControl.AssetsLockScope.Item, Optional cancel As CancellationToken = Nothing) As Task(Of T)

Type Parameters

T

result type

Parameters

context
IAssetsAccessContext

lock context

asyncAction
Func<CancellationToken,Task<T>>

action to execute

filePath
String

resource to lock

lockScope
AssetsLockScope

lock scope

cancel
CancellationToken

cancellation token

Returns

Task<T>

action result

Applies to