Provides convenience wrapper functions to run small bits of work in parallel threads, not tasks. No async/await, no Tasks (unless you want to return them and await them yourself). No TPL. No handbrakes. No magic context. No guarantees, except that your work will be executed. May make the host machine very tired.
More...
|
static Exception[] | InParallel (Action first, Action second, params Action[] more) |
| Run all actions in parallel, returning any captured exceptions.
|
static Exception[] | InParallel (int maxDegreeOfParallelism, Action first, Action second, params Action[] more) |
| Run all actions in parallel, with the provided max degree of parallelism, returning any captured exceptions.
|
static WorkResult< T >[] | InParallel< T > (Func< T > first, Func< T > second, params Func< T >[] more) |
| Run all functions in parallel, returning all results / exceptions.
|
static WorkResult< T >[] | InParallel< T > (int maxDegreeOfParallelism, Func< T > first, Func< T > second, params Func< T >[] more) |
| Run all provided functions with the max degree of parallelism, returning all results / exceptions.
|
static Exception[] | InParallel (int maxDegreeOfParallelism, IEnumerable< Action > actions) |
| Run a bunch of actions in parallel.
|
static void | Once (ref bool gateFlag, Action toRun) |
| Runs the action once and once only.
|
static T | Until< T > (Func< T, bool > validator, Func< T > generator) |
| Run the generator until the validator is satisfied and return the result.
|
static T | Until< T > (Func< T, bool > validator, Func< T, T > generator) |
| Run the generator until the validator is satisfied and return the result.
|
static async Task< T > | Until< T > (Func< T, bool > validator, Func< T, Task< T > > generator) |
| Run the generator until the validator is satisfied and return the result.
|
static async Task< T > | Until< T > (Func< T, bool > validator, Func< Task< T > > generator) |
| Run the generator until the validator is satisfied and return the result.
|
static async Task< T > | Until< T > (Func< T, Task< bool > > validator, Func< T, T > generator) |
| Run the generator until the validator is satisfied and return the result.
|
static async Task< T > | Until< T > (Func< T, Task< bool > > validator, Func< T, Task< T > > generator) |
| Run the generator until the validator is satisfied and return the result.
|
static void | WithTimeout (int timeoutMs, Action logic) |
static void | WithTimeout (TimeSpan timeout, Action logic) |
static async Task | WithTimeoutAsync (int timeoutMs, Func< Task > logic) |
static async Task | WithTimeoutAsync (TimeSpan timeout, Func< Task > logic) |
static async Task | WithTimeoutAsync (int timeoutMs, Func< CancellationToken, Task > logic) |
static async Task | WithTimeoutAsync (TimeSpan timeout, Func< CancellationToken, Task > logic) |
static async Task< T > | WithTimeoutAsync< T > (int timeoutMs, Func< CancellationToken, Task< T > > logic) |
static async Task< T > | WithTimeoutAsync< T > (TimeSpan timeout, Func< CancellationToken, Task< T > > logic) |
static async Task< T > | WithTimeoutAsync< T > (TimeSpan timeout, Func< CancellationToken, Task< T > > logic, ErrorStrategies errorStrategy) |
Provides convenience wrapper functions to run small bits of work in parallel threads, not tasks. No async/await, no Tasks (unless you want to return them and await them yourself). No TPL. No handbrakes. No magic context. No guarantees, except that your work will be executed. May make the host machine very tired.
Provides a convenience wrapper to time-out a long-running operation which has taken too long.
Provides Run.Until, a convenience mechanism to run a bit of logic until some condition is met.