Appearance
Run Method
Definition
- Namespace:
JASE - Assembly:
JASE.Concurrency.dll
Overloads
| Name | Description |
|---|---|
void Run(Func<Task> func, bool allowUnsafeBlocking = null) | Runs an asynchronous function synchronously, enforcing environment checks to avoid deadlocks. |
void Run(Func<ValueTask> func, bool allowUnsafeBlocking = null) | Runs an async method that returns a ValueTask in a blocking manner, subject to the same safety checks as the Task-based overloads. |
T Run(Func<Task<T>> func, bool allowUnsafeBlocking = null) | Runs an asynchronous function synchronously and returns its result, enforcing environment checks to avoid deadlocks. |
T Run(Func<ValueTask<T>> func, bool allowUnsafeBlocking = null) | Runs an async method that returns a ValueTask1` in a blocking manner, subject to the same safety checks as the Task-based overloads. |
void Run(Func<Task> func, bool allowUnsafeBlocking = null)
csharp
void Run(Func<Task> func, bool allowUnsafeBlocking = null)Runs an asynchronous function synchronously, enforcing environment checks to avoid deadlocks.
Parameters
| Name | Description |
|---|---|
allowUnsafeBlocking | If , bypasses the environment safety checks and allows blocking even in contexts where it is normally disallowed. This parameter takes precedence over AllowUnsafeBlocking. |
func | The asynchronous function to execute. |
void Run(Func<ValueTask> func, bool allowUnsafeBlocking = null)
csharp
void Run(Func<ValueTask> func, bool allowUnsafeBlocking = null)Runs an async method that returns a ValueTask in a blocking manner, subject to the same safety checks as the Task-based overloads.
T Run(Func<Task<T>> func, bool allowUnsafeBlocking = null)
csharp
T Run(Func<Task<T>> func, bool allowUnsafeBlocking = null)Runs an asynchronous function synchronously and returns its result, enforcing environment checks to avoid deadlocks.
Type parameters
| Name | Description |
|---|---|
T | The result type of the asynchronous operation. |
Parameters
| Name | Description |
|---|---|
allowUnsafeBlocking | If , bypasses the environment safety checks and allows blocking even in contexts where it is normally disallowed. This parameter takes precedence over AllowUnsafeBlocking. |
func | The asynchronous function to execute. |
Returns
The result value produced by func.
T Run(Func<ValueTask<T>> func, bool allowUnsafeBlocking = null)
csharp
T Run(Func<ValueTask<T>> func, bool allowUnsafeBlocking = null)Runs an async method that returns a ValueTask1` in a blocking manner, subject to the same safety checks as the Task-based overloads.