view Implab.Test/PromiseHelper.cs @ 124:a336cb13c6a9 v2

major update, added Drain mathod to AsyncQueue class
author cin
date Thu, 15 Jan 2015 02:43:14 +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;
            });
        }
    }
}