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
Syntaxpublic static class TaskExtensions
Methods
WithTimeout(Task, int, CancellationTokenSource)
Returns true if task completed, false when timeout
Declarationpublic static Task<bool> WithTimeout(this Task task, int timeout, CancellationTokenSource source = null)
Type | Name | Description |
---|---|---|
Task | task | |
int | timeout | |
CancellationTokenSource | source |
Type | Description |
---|---|
Task<bool> |
ParallelForEachAsync<T>(IEnumerable<T>, Func<T, Task>, CancellationToken, int?)
Declarationpublic static Task ParallelForEachAsync<T>(this IEnumerable<T> source, Func<T, Task> funcBody, CancellationToken cancellationToken = default, int? maxDegreeOfParallelism = null)
Type | Name | Description |
---|---|---|
IEnumerable<T> | source | |
Func<T, Task> | funcBody | |
CancellationToken | cancellationToken | |
int? | maxDegreeOfParallelism |
Type | Description |
---|---|
Task |
ParallelAsync(IEnumerable<Func<Task>>, CancellationToken, int?)
Declarationpublic static Task ParallelAsync(this IEnumerable<Func<Task>> taskFactories, CancellationToken cancellationToken = default, int? maxDegreeOfParallelism = null)
Type | Name | Description |
---|---|---|
IEnumerable<Func<Task>> | taskFactories | |
CancellationToken | cancellationToken | |
int? | maxDegreeOfParallelism |
Type | Description |
---|---|
Task |
ParallelAsync(IEnumerable<Action>, CancellationToken, int?)
Declarationpublic static Task ParallelAsync(this IEnumerable<Action> actions, CancellationToken cancellationToken = default, int? maxDegreeOfParallelism = null)
Type | Name | Description |
---|---|---|
IEnumerable<Action> | actions | |
CancellationToken | cancellationToken | |
int? | maxDegreeOfParallelism |
Type | Description |
---|---|
Task |