Provides methods to run async code synchronously and safely http://stackoverflow.com/questions/5095183/how-would-i-run-an-async-taskt-method-synchronously.
More...
|
static void | RunSync (Func< Task > task) |
| Executes an async Action synchronously.
|
static T | RunSync< T > (Func< Task< T > > task) |
| Executes an async Func<T> synchronously and returns the result.
|
◆ RunSync()
void PeanutButter.Utils.Async.RunSync |
( |
Func< Task > | task | ) |
|
|
static |
Executes an async Action synchronously.
- use when you really cannot use async/await
- NEVER use Task.Wait() or Task.Result if the underlying code uses async/await
- Parameters
-
◆ RunSync< T >()
Executes an async Func<T> synchronously and returns the result.
- use when you really cannot use async/await
- NEVER use Task.Wait() or Task.Result if the underlying code uses async/await
- Template Parameters
-
- Parameters
-
task | Task<T> method to execute |
- Returns
The documentation for this class was generated from the following file:
- source/Utils/PeanutButter.Utils/Async.cs