view Implab.Test/PromiseHelper.cs @ 97:b11c7e9d93bc v2

added enumerable interface to MTQueue
author cin
date Fri, 31 Oct 2014 17:34:54 +0300
parents 91362ffbecf8
children eb793fbbe4ea
line wrap: on
line source

using Implab.Parallels;
using System.Threading;

namespace Implab.Test {
    static class PromiseHelper {
        public static IPromise<T> Sleep<T>(int timeout, T retVal) {
            return AsyncPool.Invoke(() => {
                Thread.Sleep(timeout);
                return retVal;
            });
        }
    }
}