annotate Implab.Test/PromiseHelper.cs @ 73:3b8393be3441 v2

fixed tests
author cin
date Fri, 05 Sep 2014 00:27:14 +0400
parents 6ec82bf68c8e
children 91362ffbecf8
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;
6ec82bf68c8e refactoring
cin
parents: 10
diff changeset
2 using System;
10
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
3 using System.Collections.Generic;
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
4 using System.Linq;
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
5 using System.Text;
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
6 using System.Threading;
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
7
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
8 namespace Implab.Test {
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
9 class PromiseHelper {
73
3b8393be3441 fixed tests
cin
parents: 11
diff changeset
10 public static IPromise<T> Sleep<T>(int timeout, T retVal) {
10
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
11 return AsyncPool.Invoke(() => {
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
12 Thread.Sleep(timeout);
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
13 return retVal;
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
14 });
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
15 }
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
16 }
aa33d0bb8c0c implemeted new cancellable promises concept
cin
parents:
diff changeset
17 }