##// END OF EJS Templates
missing files
missing files

File last commit:

r203:4d9830a9bbb8 v2
r237:f2150c16b476 v2
Show More
PromiseHelper.cs
22 lines | 663 B | text/x-csharp | CSharpLexer
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;
});
}
public static IPromise Sleep(int timeout) {
return AsyncPool.Invoke((ct) => {
ct.CancellationRequested(ct.CancelOperation);
Thread.Sleep(timeout);
return 0;
});
}
}
}