Class SafeBlockingTasks
Inheritance
SafeBlockingTasks
Assembly: SoCore.dll
Syntax
public static class SafeBlockingTasks
Methods
SafeBlock(Action)
Declaration
public static void SafeBlock(Action action)
Parameters
Type |
Name |
Description |
Action |
action |
|
SafeBlock(Func<Task>)
Helper method to do a "safe" block on a Task instance, by "safe" we mean that it does not deadlock.
ThreadPool starvation could be a possibility if it's overused, however this should not be a problem, because
it is only intended for the limited areas of the code that is planned to be dropped in the future. Everywhere
else should use real async/await all the way.
Declaration
public static void SafeBlock(Func<Task> task)
Parameters
SafeBlock<T>(Func<Task<T>>)
Declaration
public static T SafeBlock<T>(Func<Task<T>> task)
Parameters
Type |
Name |
Description |
Func<Task<T>> |
task |
|
Returns
Type Parameters
SafeBlock<T>(Func<T>)
Declaration
public static T SafeBlock<T>(Func<T> action)
Parameters
Type |
Name |
Description |
Func<T> |
action |
|
Returns
Type Parameters