Skip to main content

AsyncPump

A static class in Root.Township, Alta.Utilities.

Lets main-thread code block on a Task without a deadlock, by running Unity's queued continuations while it waits.

Fields​

1 private and internal field
MemberWhat it is
private static MethodInfo execCached reflection handle to the context's private Exec method.

Methods​

MemberWhat it is
static void ProgressAllTasks()Runs the queued work on the current Unity SynchronizationContext once, by calling its private Exec through reflection.
static void UnityWait(Task task)Extension: blocks until the task completes, running queued continuations meanwhile. Logs an error and returns if the task was never started.