Parallel.ForAsync Metodo

Definizione

Overload

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

Esegue un ciclo per in cui le iterazioni possono essere eseguite in parallelo.

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

Esegue un ciclo per in cui le iterazioni possono essere eseguite in parallelo.

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

Esegue un ciclo per in cui le iterazioni possono essere eseguite in parallelo.

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

Source:
Parallel.ForEachAsync.cs
Source:
Parallel.ForEachAsync.cs

Esegue un ciclo per in cui le iterazioni possono essere eseguite in parallelo.

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

Parametri di tipo

T

Parametri

fromInclusive
T

Indice iniziale, incluso.

toExclusive
T

Indice finale, escluso.

parallelOptions
ParallelOptions

Oggetto che configura il comportamento di questa operazione.

body
Func<T,CancellationToken,ValueTask>

Delegato asincrono richiamato una volta per elemento nell'origine dati.

Restituisce

Attività che rappresenta l'intero per ogni operazione.

Eccezioni

Il valore dell'argomento body è null.

Commenti

L'operazione verrà eseguita alla maggior parte ProcessorCount delle operazioni in parallelo.

Si applica a

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

Source:
Parallel.ForEachAsync.cs
Source:
Parallel.ForEachAsync.cs

Esegue un ciclo per in cui le iterazioni possono essere eseguite in parallelo.

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

Parametri di tipo

T

Parametri

fromInclusive
T

Indice iniziale, incluso.

toExclusive
T

Indice finale, escluso.

body
Func<T,CancellationToken,ValueTask>

Delegato asincrono richiamato una volta per elemento nell'origine dati.

Restituisce

Attività che rappresenta l'intero per ogni operazione.

Eccezioni

Il valore dell'argomento body è null.

Commenti

L'operazione verrà eseguita alla maggior parte ProcessorCount delle operazioni in parallelo.

Si applica a

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

Source:
Parallel.ForEachAsync.cs
Source:
Parallel.ForEachAsync.cs

Esegue un ciclo per in cui le iterazioni possono essere eseguite in parallelo.

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

Parametri di tipo

T

Parametri

fromInclusive
T

Indice iniziale, incluso.

toExclusive
T

Indice finale, escluso.

cancellationToken
CancellationToken

Token di annullamento che può essere usato per annullare l'oggetto per ogni operazione.

body
Func<T,CancellationToken,ValueTask>

Delegato asincrono richiamato una volta per elemento nell'origine dati.

Restituisce

Attività che rappresenta l'intero per ogni operazione.

Eccezioni

Il valore dell'argomento body è null.

Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.

Commenti

L'operazione verrà eseguita alla maggior parte ProcessorCount delle operazioni in parallelo.

Si applica a