annotate Implab.Test/PromiseHelper.cs @ 77:91362ffbecf8 v2

ported tests to mono
author cin
date Thu, 11 Sep 2014 10:56:14 +0400
parents 3b8393be3441
children eb793fbbe4ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
6ec82bf68c8e refactoring
cin
parents: 10
diff changeset
1 using Implab.Parallels;
10
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
2 using System.Threading;
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
3
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
4 namespace Implab.Test {
77
91362ffbecf8 ported tests to mono
cin
parents: 73
diff changeset
5 static class PromiseHelper {
73
3b8393be3441 fixed tests
cin
parents: 11
diff changeset
6 public static IPromise<T> Sleep<T>(int timeout, T retVal) {
10
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
7 return AsyncPool.Invoke(() => {
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
8 Thread.Sleep(timeout);
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
9 return retVal;
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
10 });
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
11 }
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
12 }
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
13 }