Table of Contents

Class TaskExtensions

Namespace
WindowSill.API
Assembly
WindowSill.API.dll

Provides a set of helper method to play around with threads.

public static class TaskExtensions
Inheritance
TaskExtensions
Inherited Members

Methods

CompleteOnCurrentThread(Task)

Gets the result of the task synchronously, on the current thread.

public static void CompleteOnCurrentThread(this Task task)

Parameters

task Task

CompleteOnCurrentThread<T>(Task<T>)

Gets the result of the task synchronously, on the current thread.

public static T CompleteOnCurrentThread<T>(this Task<T> task)

Parameters

task Task<T>

Returns

T

Type Parameters

T

Forget(Task)

Runs a task without waiting for its result.

public static void Forget(this Task _)

Parameters

_ Task

ForgetSafely(Task, Action<Exception>?)

Runs a task without waiting for its result. Swallows or handle any exception caused by the task.

public static void ForgetSafely(this Task task, Action<Exception>? errorHandler = null)

Parameters

task Task
errorHandler Action<Exception>

The action to run when an exception is caught.

Forget<T>(Task<T>)

Runs a task without waiting for its result.

public static void Forget<T>(this Task<T> _)

Parameters

_ Task<T>

Type Parameters

T