Esempio n. 1
0
 public static IPromise ContinueWith <T>(this IPromise <T> promise, Action callback)
 {
     return(promise.ContinueWith(() =>
     {
         callback();
         return Promise.Resolved();
     }));
 }
Esempio n. 2
0
        public void RSGPromise()
        {
            var deferred = new Promise <object>();
            IPromise <object> promise = deferred;

            for (int i = 0; i < N; ++i)
            {
                promise = promise
                          // Extension methods created here.
                          .ContinueWith(() => { })
                          .ContinueWith(() => Instances.vector)
                          .ContinueWith(() => Instances.obj);
            }

            promise.Done();
            deferred.Resolve(Instances.obj);
        }
Esempio n. 3
0
        public void RSGPromise()
        {
            var deferred = new Promise <object>();
            IPromise <object> promise = deferred;

            for (int i = 0; i < N; ++i)
            {
                promise = promise
                          // Native methods.
                          .ContinueWith(() => RSGPromiseHelper.rsgVoid)
                          .ContinueWith(() => RSGPromiseHelper.rsgVector)
                          .ContinueWith(() => RSGPromiseHelper.rsgObject);
            }

            promise.Done();
            deferred.Resolve(Instances.obj);
        }
Esempio n. 4
0
        public void RSGPromise()
        {
            var deferred = new Promise <object>();
            IPromise <object> promise = deferred;

            for (int i = 0; i < N; ++i)
            {
                int index = i;
                promise = promise
                          // Native methods.
                          .ContinueWith(() => (IPromise)RSGPromiseHelper.rsgVoids[index])
                          .ContinueWith(() => (IPromise <Vector4>)RSGPromiseHelper.rsgVectors[index])
                          .ContinueWith(() => (IPromise <object>)RSGPromiseHelper.rsgObjects[index]);
            }

            promise.Done();
            deferred.Resolve(Instances.obj);
            RSGPromiseHelper.ResolveDeferreds();
        }
        public void RSGPromise()
        {
            var deferred = new Promise <object>();
            IPromise <object> promise = deferred;

            for (int i = 0; i < N; ++i)
            {
                promise = promise
                          // Extension methods created here.
                          .ContinueWith(() => { })
                          .ContinueWith(() => Program.vector)
                          .ContinueWith(() => Program.obj)
                          // Native methods.
                          .ContinueWith(() => RSGPromiseHelper.rsgVoid)
                          .ContinueWith(() => RSGPromiseHelper.rsgVector)
                          .ContinueWith(() => RSGPromiseHelper.rsgObject);
            }

            promise.Done();
            deferred.Resolve(Program.obj);
        }
Esempio n. 6
0
 public static IPromise <TConvert> ContinueWith <T, TConvert>(this IPromise <T> promise, Func <TConvert> callback)
 {
     return(promise.ContinueWith(() => Promise <TConvert> .Resolved(callback())));
 }