Table of Contents

Run Class

public static class Run
Inheritance
Run

Properties

ConcurrentThreadCount

Methods

CreateNewScheduler(int)
GetElapsedTime(long)
GetElapsedTime(long, long)
GetTimerToken(int, int)
InThreadPool(IRunnable, CancellationToken)
InThreadPool(IRunnable, TaskScheduler, CancellationToken)
InThreadPool(Action)
InThreadPool(Func<CancellationToken, ValueTask>, CancellationToken)
InThreadPool<T>(T, Action<T>)
InThreadPool<T>(T, Func<T, CancellationToken, ValueTask>, CancellationToken)
InitializeMainThreadContext()

NOTE: must be called on main thread.

OnMainThreadAndForget<T>(T, Action<T>)

NOTE: this method always Post job to main thread even though it is invoked on main thread. (ie. this method is immediately finished but submitted job is NOT finished immediately)

OnMainThread<T>(T, Action<T>)

NOTE: this method is blocking current thread until submitted main thread job is finished.

OnMainThread<T>(T, Func<T, CancellationToken, Task>)
OnMainThread<T>(T, Func<T, CancellationToken, ValueTask>)
SetConcurrentThreadCount(int)
SetConcurrentThreadCount(ref ConcurrentExclusiveSchedulerPair, int, int, TaskScheduler?)
SetExceptionHandler(Func<Exception, bool>)

Invoked when error occurred. Return true if exception handled in your handler. (ie. stop flowing to subsequent call stack)

Args: (exception)
Shutdown(int)

Wait for task completion in sync. Designed for blocking application quit before completion.

WaitForTaskCompletion(Func<CancellationToken, Task>, CancellationToken)
WaitForValueTaskCompletion(Func<CancellationToken, ValueTask>, CancellationToken)
WaitForValueTaskCompletion<TState>(TState, Func<TState, CancellationToken, ValueTask>, CancellationToken)