using Implab.Parallels; using System.Threading; namespace Implab.Test { static class PromiseHelper { public static IPromise Sleep(int timeout, T retVal) { return AsyncPool.Invoke((ct) => { ct.CancellationRequested(ct.CancelOperation); Thread.Sleep(timeout); return retVal; }); } } }