view Implab.Test/PromiseHelper.cs @ 79:05e6468f066f v2

sync
author cin
date Mon, 22 Sep 2014 18:20:49 +0400
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;
            });
        }
    }
}