Mercurial > pub > ImplabNet
comparison Implab.Test/PromiseHelper.cs @ 18:0c924dff5498
Слияние с promises
| author | cin |
|---|---|
| date | Fri, 08 Nov 2013 01:27:04 +0400 |
| parents | 6ec82bf68c8e |
| children | 3b8393be3441 |
comparison
equal
deleted
inserted
replaced
| 6:dfa21d507bc5 | 18:0c924dff5498 |
|---|---|
| 1 using Implab.Parallels; | |
| 2 using System; | |
| 3 using System.Collections.Generic; | |
| 4 using System.Linq; | |
| 5 using System.Text; | |
| 6 using System.Threading; | |
| 7 | |
| 8 namespace Implab.Test { | |
| 9 class PromiseHelper { | |
| 10 public static Promise<T> Sleep<T>(int timeout, T retVal) { | |
| 11 return AsyncPool.Invoke(() => { | |
| 12 Thread.Sleep(timeout); | |
| 13 return retVal; | |
| 14 }); | |
| 15 } | |
| 16 } | |
| 17 } |
