TaskSourceclass

Provides a way for us to cancel tasks after common async shit is executed.

objectTaskSource
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public sealed struct Sandbox.TaskSource

Methods33

Showing 33 methods

public static Sandbox.TaskSource Create(System.Threading.CancellationToken token = null)PUBLICSTATIC

ParameterTypeDescription
token = nullCancellationToken
Returns:TaskSource

public static System.Threading.CancellationTokenSource CreateLinkedTokenSource()PUBLICSTATIC

Create a token source, which will also be cancelled when sessions end

Returns:CancellationTokenSource

public System.Threading.Tasks.Task FixedUpdate()PUBLICFIXED TICK

Wait until the next fixed update

Returns:Task

public System.Threading.Tasks.Task Frame()PUBLIC

Wait until the start of the next frame

Returns:Task

public System.Threading.Tasks.Task FrameEnd()PUBLIC

Wait until the end of the frame

Returns:Task

public System.Threading.Tasks.Task FromCanceled(System.Threading.CancellationToken token)PUBLIC

ParameterTypeDescription
tokenCancellationToken
Returns:Task

public System.Threading.Tasks.Task FromException(System.Exception e)PUBLIC

ParameterTypeDescription
eException
Returns:Task

public System.Threading.Tasks.Task`1<T> FromResult(T t)PUBLIC

ParameterTypeDescription
tT
Returns:Task<T>

public void WaitAll(System.Threading.Tasks.Task[] tasks)PUBLIC

ParameterTypeDescription
tasksTask[]
Returns:void

public void WaitAny(System.Threading.Tasks.Task[] tasks)PUBLIC

ParameterTypeDescription
tasksTask[]
Returns:void

public Sandbox.Tasks.SyncTask WorkerThread()PUBLIC

Continues on a worker thread.

Returns:SyncTask

public System.Threading.Tasks.Task Yield()PUBLIC

Returns:Task

Properties2

Showing 2 properties

public System.Threading.Tasks.Task Sandbox.TaskSource.CompletedTask { get; set; }PUBLICGETSET

Returns:Task

public bool Sandbox.TaskSource.IsValid { get; set; }PUBLICGETSET

Returns:bool

On this page

Methodspublic static Sandbox.TaskSource Create(System.Threading.CancellationToken token = null)public static System.Threading.CancellationTokenSource CreateLinkedTokenSource()public System.Threading.Tasks.Task Delay(System.Int32 ms, System.Threading.CancellationToken ct)public System.Threading.Tasks.Task Delay(System.Int32 ms)public System.Threading.Tasks.Task DelayRealtime(System.Int32 ms, System.Threading.CancellationToken ct)public System.Threading.Tasks.Task DelayRealtime(System.Int32 ms)public System.Threading.Tasks.Task DelayRealtimeSeconds(System.Single seconds, System.Threading.CancellationToken ct)public System.Threading.Tasks.Task DelayRealtimeSeconds(System.Single seconds)public System.Threading.Tasks.Task DelaySeconds(System.Single seconds, System.Threading.CancellationToken ct)public System.Threading.Tasks.Task DelaySeconds(System.Single seconds)public System.Threading.Tasks.Task FixedUpdate()public System.Threading.Tasks.Task Frame()public System.Threading.Tasks.Task FrameEnd()public System.Threading.Tasks.Task FromCanceled(System.Threading.CancellationToken token)public System.Threading.Tasks.Task FromException(System.Exception e)public System.Threading.Tasks.Task`1<T> FromResult(T t)public Sandbox.Tasks.SyncTask MainThread()public System.Threading.Tasks.Task RunInThreadAsync(System.Action action)public System.Threading.Tasks.Task RunInThreadAsync(System.Func`1<System.Threading.Tasks.Task> task)public System.Threading.Tasks.Task`1<T> RunInThreadAsync(System.Func`1<T> func)public System.Threading.Tasks.Task`1<T> RunInThreadAsync(System.Func`1<System.Threading.Tasks.Task`1<T>> task)public System.Void WaitAll(System.Threading.Tasks.Task[] tasks)public System.Void WaitAny(System.Threading.Tasks.Task[] tasks)public System.Threading.Tasks.Task WhenAll(System.Collections.Generic.IEnumerable`1<System.Threading.Tasks.Task> tasks)public System.Threading.Tasks.Task WhenAll(System.Threading.Tasks.Task[] tasks)public System.Threading.Tasks.Task`1<T[]> WhenAll(System.Collections.Generic.IEnumerable`1<System.Threading.Tasks.Task`1<T>> tasks)public System.Threading.Tasks.Task`1<T[]> WhenAll(System.Threading.Tasks.Task`1<T>[] tasks)public System.Threading.Tasks.Task`1<System.Threading.Tasks.Task> WhenAny(System.Collections.Generic.IEnumerable`1<System.Threading.Tasks.Task> tasks)public System.Threading.Tasks.Task`1<System.Threading.Tasks.Task> WhenAny(System.Threading.Tasks.Task[] tasks)public System.Threading.Tasks.Task`1<System.Threading.Tasks.Task`1<T>> WhenAny(System.Collections.Generic.IEnumerable`1<System.Threading.Tasks.Task`1<T>> tasks)public System.Threading.Tasks.Task`1<System.Threading.Tasks.Task`1<T>> WhenAny(System.Threading.Tasks.Task`1<T>[] tasks)public Sandbox.Tasks.SyncTask WorkerThread()public System.Threading.Tasks.Task Yield()Propertiespublic System.Threading.Tasks.Task Sandbox.TaskSource.CompletedTask { get; set; }public System.Boolean Sandbox.TaskSource.IsValid { get; set; }Metadata