Skip to content

Run Method ​

Definition ​

  • Namespace: JASE
  • Assembly: JASE.Concurrency.dll

Overloads ​

NameDescription
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 ​

NameDescription
allowUnsafeBlockingIf , bypasses the environment safety checks and allows blocking even in contexts where it is normally disallowed. This parameter takes precedence over AllowUnsafeBlocking.
funcThe 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 ​

NameDescription
TThe result type of the asynchronous operation.

Parameters ​

NameDescription
allowUnsafeBlockingIf , bypasses the environment safety checks and allows blocking even in contexts where it is normally disallowed. This parameter takes precedence over AllowUnsafeBlocking.
funcThe 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.