Ejemplo n.º 1
0
        public IPromise SetTimeout(int delay, Action action, PromisePriority priority)
        {
            if (_disposed)
            {
                throw new ObjectDisposedException("PromiseFactory");
            }

            switch (priority)
            {
            case PromisePriority.Normal:
                return(new NormalPromise(this, _taskFactory, _taskFactory.BeginFuture(Environment.TickCount + delay, action)));

            default:
                return(new NormalPromise(this, _taskFactory, _taskFactory.BeginFuture(Environment.TickCount + delay, action, (int)priority)));
            }
        }