Mercurial > pub > ImplabNet
view Implab.Test/PromiseHelper.cs @ 167:96681e9d0cea ref20160224
sync
author | cin |
---|---|
date | Wed, 02 Mar 2016 00:20:48 +0300 |
parents | eb793fbbe4ea |
children | 4d9830a9bbb8 |
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((ct) => { ct.CancellationRequested(ct.CancelOperation); Thread.Sleep(timeout); return retVal; }); } } }