Exemple #1
0
        public IPromise ThenWaitUntil(YieldInstruction yieldInstruction)
        {
            var p = Create();

            if (CurrentState == EPromiseState.Resolved)
            {
                CoroutineExtensions.WaitUntil(yieldInstruction).ThenResolvePromise(p, PromisedObject);
            }
            else
            {
                _resolutions.Add(WaitUntilResolution.Create(yieldInstruction, p));
            }

            return(p);
        }
Exemple #2
0
        public IPromise ThenWaitUntil(Func <bool> evaluator)
        {
            var p = Create();

            if (CurrentState == EPromiseState.Resolved)
            {
                CoroutineExtensions.WaitUntil(evaluator).ThenResolvePromise(p, PromisedObject);
            }
            else
            {
                _resolutions.Add(WaitUntilResolution.Create(evaluator, p));
            }

            return(p);
        }