Parallel.ForAsync Methode

Definitie

Overloads

Name Description
ForAsync<T>(T, T, ParallelOptions, Func<T,CancellationToken,ValueTask>)

Hiermee wordt een for-lus uitgevoerd waarin iteraties parallel kunnen worden uitgevoerd.

ForAsync<T>(T, T, Func<T,CancellationToken,ValueTask>)

Hiermee wordt een for-lus uitgevoerd waarin iteraties parallel kunnen worden uitgevoerd.

ForAsync<T>(T, T, CancellationToken, Func<T,CancellationToken,ValueTask>)

Hiermee wordt een for-lus uitgevoerd waarin iteraties parallel kunnen worden uitgevoerd.

ForAsync<T>(T, T, ParallelOptions, Func<T,CancellationToken,ValueTask>)

Bron:
Parallel.ForEachAsync.cs
Bron:
Parallel.ForEachAsync.cs
Bron:
Parallel.ForEachAsync.cs
Bron:
Parallel.ForEachAsync.cs

Hiermee wordt een for-lus uitgevoerd waarin iteraties parallel kunnen worden uitgevoerd.

public:
generic <typename T>
 where T : System::Numerics::IBinaryInteger<T> static System::Threading::Tasks::Task ^ ForAsync(T fromInclusive, T toExclusive, System::Threading::Tasks::ParallelOptions ^ parallelOptions, Func<T, System::Threading::CancellationToken, System::Threading::Tasks::ValueTask> ^ body);
public static System.Threading.Tasks.Task ForAsync<T>(T fromInclusive, T toExclusive, System.Threading.Tasks.ParallelOptions parallelOptions, Func<T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask> body) where T : System.Numerics.IBinaryInteger<T>;
static member ForAsync : 'T * 'T * System.Threading.Tasks.ParallelOptions * Func<'T, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask (requires 'T :> System.Numerics.IBinaryInteger<'T>)> -> System.Threading.Tasks.Task (requires 'T :> System.Numerics.IBinaryInteger<'T>)
Public Shared Function ForAsync(Of T As IBinaryInteger(Of T)) (fromInclusive As T, toExclusive As T, parallelOptions As ParallelOptions, body As Func(Of T, CancellationToken, ValueTask)) As Task

Type parameters

T

Parameters

fromInclusive
T

De beginindex, inclusief.

toExclusive
T

De eindindex, exclusief.

parallelOptions
ParallelOptions

Een object dat het gedrag van deze bewerking configureert.

body
Func<T,CancellationToken,ValueTask>

Een asynchrone gemachtigde die eenmaal per element in de gegevensbron wordt aangeroepen.

Retouren

Een taak die het hele voor elke bewerking vertegenwoordigt.

Uitzonderingen

Het body argument is null.

Opmerkingen

De bewerking wordt maximaal ProcessorCount parallel uitgevoerd.

Van toepassing op

ForAsync<T>(T, T, Func<T,CancellationToken,ValueTask>)

Bron:
Parallel.ForEachAsync.cs
Bron:
Parallel.ForEachAsync.cs
Bron:
Parallel.ForEachAsync.cs
Bron:
Parallel.ForEachAsync.cs

Hiermee wordt een for-lus uitgevoerd waarin iteraties parallel kunnen worden uitgevoerd.

public:
generic <typename T>
 where T : System::Numerics::IBinaryInteger<T> static System::Threading::Tasks::Task ^ ForAsync(T fromInclusive, T toExclusive, Func<T, System::Threading::CancellationToken, System::Threading::Tasks::ValueTask> ^ body);
public static System.Threading.Tasks.Task ForAsync<T>(T fromInclusive, T toExclusive, Func<T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask> body) where T : System.Numerics.IBinaryInteger<T>;
static member ForAsync : 'T * 'T * Func<'T, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask (requires 'T :> System.Numerics.IBinaryInteger<'T>)> -> System.Threading.Tasks.Task (requires 'T :> System.Numerics.IBinaryInteger<'T>)
Public Shared Function ForAsync(Of T As IBinaryInteger(Of T)) (fromInclusive As T, toExclusive As T, body As Func(Of T, CancellationToken, ValueTask)) As Task

Type parameters

T

Parameters

fromInclusive
T

De beginindex, inclusief.

toExclusive
T

De eindindex, exclusief.

body
Func<T,CancellationToken,ValueTask>

Een asynchrone gemachtigde die eenmaal per element in de gegevensbron wordt aangeroepen.

Retouren

Een taak die het hele voor elke bewerking vertegenwoordigt.

Uitzonderingen

Het body argument is null.

Opmerkingen

De bewerking wordt maximaal ProcessorCount parallel uitgevoerd.

Van toepassing op

ForAsync<T>(T, T, CancellationToken, Func<T,CancellationToken,ValueTask>)

Bron:
Parallel.ForEachAsync.cs
Bron:
Parallel.ForEachAsync.cs
Bron:
Parallel.ForEachAsync.cs
Bron:
Parallel.ForEachAsync.cs

Hiermee wordt een for-lus uitgevoerd waarin iteraties parallel kunnen worden uitgevoerd.

public:
generic <typename T>
 where T : System::Numerics::IBinaryInteger<T> static System::Threading::Tasks::Task ^ ForAsync(T fromInclusive, T toExclusive, System::Threading::CancellationToken cancellationToken, Func<T, System::Threading::CancellationToken, System::Threading::Tasks::ValueTask> ^ body);
public static System.Threading.Tasks.Task ForAsync<T>(T fromInclusive, T toExclusive, System.Threading.CancellationToken cancellationToken, Func<T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask> body) where T : System.Numerics.IBinaryInteger<T>;
static member ForAsync : 'T * 'T * System.Threading.CancellationToken * Func<'T, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask (requires 'T :> System.Numerics.IBinaryInteger<'T>)> -> System.Threading.Tasks.Task (requires 'T :> System.Numerics.IBinaryInteger<'T>)
Public Shared Function ForAsync(Of T As IBinaryInteger(Of T)) (fromInclusive As T, toExclusive As T, cancellationToken As CancellationToken, body As Func(Of T, CancellationToken, ValueTask)) As Task

Type parameters

T

Parameters

fromInclusive
T

De beginindex, inclusief.

toExclusive
T

De eindindex, exclusief.

cancellationToken
CancellationToken

Een annuleringstoken dat kan worden gebruikt om de voor elke bewerking te annuleren.

body
Func<T,CancellationToken,ValueTask>

Een asynchrone gemachtigde die eenmaal per element in de gegevensbron wordt aangeroepen.

Retouren

Een taak die het hele voor elke bewerking vertegenwoordigt.

Uitzonderingen

Het body argument is null.

Het annuleringstoken is geannuleerd. Deze uitzondering wordt opgeslagen in de geretourneerde taak.

Opmerkingen

De bewerking wordt maximaal ProcessorCount parallel uitgevoerd.

Van toepassing op