Helper class to run async methods within a sync process. Source: https://www.ryadel.com/en/asyncutil-c-helper-class-async-method-sync-result-wait/
Westwind.Utilities.AsyncUtils
public static class AsyncUtils : object
Class Members
Member | Description | |
---|---|---|
DelayExecution |
Executes an Action after a delay public static void DelayExecution(int delayMs,
Action action,
Action |
|
DelayExecution |
public static void DelayExecution |
|
FireAndForget |
Ensures safe operation of a task without await even if an execution fails with an exception. This forces the exception to be cleared unlike a non-continued task. public static void FireAndForget(Task t) public static void FireAndForget(Task t,
Action |
|
RunSync |
Executes an async Task method which has a void return value synchronously USAGE: AsyncUtil.RunSync(() => AsyncMethod()); public static void RunSync(Func public static void RunSync(Func |
|
RunSync |
public static TResult RunSync public static TResult RunSync |
Requirements
Namespace: Westwind.UtilitiesAssembly: westwind.utilities.dll
© West Wind Technologies, 1996-2024 • Updated: 06/29/24
Comment or report problem with topic