ParallelHelperForAsync(Int32, Int32, TaskConfig, ActionInt32) Method
Namespace: KGySoft.ThreadingAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
public static Task<bool> ForAsync(
int fromInclusive,
int toExclusive,
TaskConfig? asyncConfig,
Action<int> body
)
Public Shared Function ForAsync (
fromInclusive As Integer,
toExclusive As Integer,
asyncConfig As TaskConfig,
body As Action(Of Integer)
) As Task(Of Boolean)
public:
static Task<bool>^ ForAsync(
int fromInclusive,
int toExclusive,
TaskConfig^ asyncConfig,
Action<int>^ body
)
static member ForAsync :
fromInclusive : int *
toExclusive : int *
asyncConfig : TaskConfig *
body : Action<int> -> Task<bool>
- fromInclusive Int32
- The start index, inclusive.
- toExclusive Int32
- The end index, exclusive.
- asyncConfig TaskConfig
- An optional configuration to adjust parallelization or cancellation.
This method does not report progress even if Progress is set in this parameter.
To report progress use the ForAsyncT(T, Int32, Int32, TaskConfig, ActionInt32) overload.
- body ActionInt32
- The delegate that is invoked once per iteration.
TaskBooleanA task that represents the asynchronous operation. Its result is
, if the operation completed successfully,
or
, if the operation has been canceled and
ThrowIfCanceled in
asyncConfig parameter was
.