annotate Implab/Promise.cs @ 201:d7cd7a83189a v2

TraceLog tests
author cin
date Mon, 17 Oct 2016 00:36:36 +0300
parents 8c0b95069066
children 8200ab154c8a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
119
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
1 using System;
144
8c0b95069066 DRAFT: refactoring
cin
parents: 138
diff changeset
2 using Implab.Parallels;
119
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
3
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
4 namespace Implab {
144
8c0b95069066 DRAFT: refactoring
cin
parents: 138
diff changeset
5 public class Promise : AbstractPromise, IDeferred {
8c0b95069066 DRAFT: refactoring
cin
parents: 138
diff changeset
6 public static readonly Promise SUCCESS;
119
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
7
144
8c0b95069066 DRAFT: refactoring
cin
parents: 138
diff changeset
8 static Promise() {
8c0b95069066 DRAFT: refactoring
cin
parents: 138
diff changeset
9 SUCCESS = new Promise();
8c0b95069066 DRAFT: refactoring
cin
parents: 138
diff changeset
10 SUCCESS.Resolve();
119
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
11 }
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
12
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
13 public void Resolve() {
144
8c0b95069066 DRAFT: refactoring
cin
parents: 138
diff changeset
14 SetResult();
119
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
15 }
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
16
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
17 public void Reject(Exception error) {
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
18 SetError(error);
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
19 }
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
20 }
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
21 }
2573b562e328 Promises rewritten, added improved version of AsyncQueue
cin
parents: 112
diff changeset
22