Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE formengine.io.

Class TaskExtensions

Inheritance

↳ object

    ↳ TaskExtensions

Inherited Members

Equals(object)

Equals(object, object)

GetHashCode()

GetType()

MemberwiseClone()

ReferenceEquals(object, object)

ToString()

Namespace: OptimaJet.Workflow.Core

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public static class TaskExtensions

Methods

WithTimeout(Task, int, CancellationTokenSource)

Returns true if task completed, false when timeout

Declaration
public static Task<bool> WithTimeout(this Task task, int timeout, CancellationTokenSource source = null)
Parameters
TypeNameDescription
Tasktask
inttimeout
CancellationTokenSourcesource
Returns
TypeDescription
Task<bool>

ParallelForEachAsync<T>(IEnumerable<T>, Func<T, Task>, CancellationToken, int?)

Declaration
public static Task ParallelForEachAsync<T>(this IEnumerable<T> source, Func<T, Task> funcBody, CancellationToken cancellationToken = default, int? maxDegreeOfParallelism = null)
Parameters
TypeNameDescription
IEnumerable<T>source
Func<T, Task>funcBody
CancellationTokencancellationToken
int?maxDegreeOfParallelism
Returns
TypeDescription
Task

ParallelAsync(IEnumerable<Func<Task>>, CancellationToken, int?)

Declaration
public static Task ParallelAsync(this IEnumerable<Func<Task>> taskFactories, CancellationToken cancellationToken = default, int? maxDegreeOfParallelism = null)
Parameters
TypeNameDescription
IEnumerable<Func<Task>>taskFactories
CancellationTokencancellationToken
int?maxDegreeOfParallelism
Returns
TypeDescription
Task

ParallelAsync(IEnumerable<Action>, CancellationToken, int?)

Declaration
public static Task ParallelAsync(this IEnumerable<Action> actions, CancellationToken cancellationToken = default, int? maxDegreeOfParallelism = null)
Parameters
TypeNameDescription
IEnumerable<Action>actions
CancellationTokencancellationToken
int?maxDegreeOfParallelism
Returns
TypeDescription
Task