annotate Implab.Test/PromiseHelper.cs @ 10:aa33d0bb8c0c
promises
implemeted new cancellable promises concept
author |
cin |
date |
Sun, 03 Nov 2013 18:07:38 +0400 |
parents |
|
children |
6ec82bf68c8e |
rev |
line source |
10
|
1 using System;
|
|
2 using System.Collections.Generic;
|
|
3 using System.Linq;
|
|
4 using System.Text;
|
|
5 using System.Threading;
|
|
6
|
|
7 namespace Implab.Test {
|
|
8 class PromiseHelper {
|
|
9 public static Promise<T> Sleep<T>(int timeout, T retVal) {
|
|
10 return AsyncPool.Invoke(() => {
|
|
11 Thread.Sleep(timeout);
|
|
12 return retVal;
|
|
13 });
|
|
14 }
|
|
15 }
|
|
16 }
|