API Reference
Class
ConsoleRun
Runs work over many items with a live view of the run (the C# side of ForEach-ConsoleItem).
Inheritance
- Object
- ConsoleRun
Methods
public static async Task<IReadOnlyList<RunResult<TItem?, TResult?>>> ForEachAsync<TItem, TResult>(IEnumerable<TItem?> items, Func<TItem?, CancellationToken, Task<TResult?>> body, RunOptions? options = null, CancellationToken cancellationToken = default) #Returns:
Task<IReadOnlyList<RunResult<TItem?, TResult?>>>Runs body for every item, at most RunOptions.ThrottleLimit at a time, showing the run (summary line, item cells, running items, failures; one line per item when the output is not interactive). An item that throws, or runs past RunOptions.Timeout, counts as failed and the run goes on; cancelling stops starting new items, cancels the running ones and counts the rest as skipped.
Type Parameters
- TItem
- The item type.
- TResult
- The result type.
Parameters
- items System.Collections.Generic.IEnumerable<TItem?>
- The items.
- body System.Func<TItem?, System.Threading.CancellationToken, System.Threading.Tasks.Task<TResult?>>
- The work for one item; observe the token for timeouts and cancellation.
- options ConsoleMonster.Live.RunOptions? = null
- Options, or null for the defaults.
- cancellationToken System.Threading.CancellationToken = default
- Stops the run.
Returns
One result per item, in input order (items never started are left out).
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?