Esempio n. 1
0
        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();
        }
Esempio n. 2
0
 void IStateMachineBoxAwareAwaiter.UnsafeOnCompleted(IStateMachineBox box)
 {
     box.SetScheduler(_scheduler);
     box.Invoke();
 }