Mercurial > pub > ImplabNet
comparison Implab/PromiseExtensions.cs @ 136:e9e7940c7d98 v2
shared locks + tests
| author | cin |
|---|---|
| date | Mon, 16 Feb 2015 01:14:09 +0300 |
| parents | a336cb13c6a9 |
| children | f75cfa58e3d4 |
comparison
equal
deleted
inserted
replaced
| 135:656815cb7147 | 136:e9e7940c7d98 |
|---|---|
| 99 | 99 |
| 100 int count = that.Count; | 100 int count = that.Count; |
| 101 int errors = 0; | 101 int errors = 0; |
| 102 var medium = new Promise(); | 102 var medium = new Promise(); |
| 103 | 103 |
| 104 if (count == 0) { | |
| 105 medium.Resolve(); | |
| 106 return medium; | |
| 107 } | |
| 108 | |
| 104 medium.On(() => { | 109 medium.On(() => { |
| 105 foreach(var p2 in that) | 110 foreach(var p2 in that) |
| 106 p2.Cancel(); | 111 p2.Cancel(); |
| 107 }, PromiseEventType.ErrorOrCancel); | 112 }, PromiseEventType.ErrorOrCancel); |
| 108 | 113 |
