Class TaskExtensions
Extension methods to make working with System.Threading.Tasks.Task
easier.
Assembly: Dalamud.dll
View Source
Declaration
public static class TaskExtensions
Methods
WaitSafely(Task)
Safe alternative to Task.Wait which ensures the calling thread is not a thread pool thread.
View Source
Declaration
public static void WaitSafely(this Task task)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.Task | task | The task to be awaited. |
GetResultSafely<T>(Task<T>)
Safe alternative to Task.Result which ensures the calling thread is not a thread pool thread.
View Source
Declaration
public static T GetResultSafely<T>(this Task<T> task)
Returns
<T>
: The result.
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.Task<<T>> | task | The target task. |
Type Parameters
Name | Description |
---|---|
T | The type of the result. |