void IStateMachineBoxAwareAwaiter.UnsafeOnCompleted(IStateMachineBox box) { var promise = _future.GetPromise(); if (promise != null) { promise.AddContinuation(box); return; } // If promise is null, it means the future was created from a result, // invoke the continuation immediately if (_scheduler != null) { box.SetScheduler(_scheduler); box.Invoke(); return; } box.MoveNext(); }
void IStateMachineBoxAwareAwaiter.UnsafeOnCompleted(IStateMachineBox box) { box.SetScheduler(_scheduler); box.Invoke(); }