NLog.Common.AsyncHelpers
Helpers for asynchronous operations.
public static void ForEachItemInParallel<T>(IEnumerable<T> values, AsyncContinuation asyncContinuation, AsynchronousAction<T> action)
Iterates over all items in the given collection and runs the specified action
in parallel (each action executes on a thread from thread pool).
public static void ForEachItemSequentially<T>(IEnumerable<T> items, AsyncContinuation asyncContinuation, AsynchronousAction<T> action)
Iterates over all items in the given collection and runs the specified action
in sequence (each action executes only after the preceding one has completed without an error).
Gets the combined exception from all exceptions in the list.
public static AsyncContinuation PrecededBy(AsyncContinuation asyncContinuation, AsynchronousAction action)
Modifies the continuation by pre-pending given action to execute just before it.
Wraps the continuation with a guard which will only make sure that the continuation function
is invoked only once.
public static void Repeat(int repeatCount, AsyncContinuation asyncContinuation, AsynchronousAction action)
Repeats the specified asynchronous action multiple times and invokes asynchronous continuation at the end.
Runs the specified asynchronous action synchronously (blocks until the continuation has
been invoked).
Attaches a timeout to a continuation which will invoke the continuation when the specified
timeout has elapsed.