Mercurial > pub > ImplabNet
annotate Implab/IPromiseBase.cs @ 33:b255e4aeef17
removed the reference to the parent from the promise object this allows
resolved promises to release parents and results they are holding.
Added complete set of operations to IPromiseBase interface
Subscribing to the cancellation event of the promise should not affect it's
IsExclusive property
More tests.
author | cin |
---|---|
date | Thu, 10 Apr 2014 02:39:29 +0400 |
parents | 768f7deeb55b |
children |
rev | line source |
---|---|
25 | 1 using System; |
2 using System.Collections.Generic; | |
3 using System.Linq; | |
4 using System.Text; | |
5 | |
6 namespace Implab { | |
7 public interface IPromiseBase: ICancellable { | |
8 /// <summary> | |
9 /// Check whereather the promise has no more than one dependent promise. | |
10 /// </summary> | |
11 bool IsExclusive { | |
12 get; | |
13 } | |
14 | |
29 | 15 /// <summary> |
16 /// Тип результата, получаемого через данное обещание. | |
17 /// </summary> | |
18 Type PromiseType { get; } | |
19 | |
25 | 20 bool IsResolved { get; } |
21 | |
22 bool IsCancelled { get; } | |
26 | 23 |
24 IPromiseBase Then(Action success,ErrorHandler error); | |
25 IPromiseBase Then(Action success); | |
33
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
29
diff
changeset
|
26 IPromiseBase Error(ErrorHandler error); |
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
29
diff
changeset
|
27 IPromiseBase Anyway(Action handler); |
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
29
diff
changeset
|
28 IPromiseBase Finally(Action handler); |
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
29
diff
changeset
|
29 IPromiseBase Cancelled(Action handler); |
26 | 30 |
29 | 31 IPromise<T> Cast<T>(); |
32 | |
33
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
29
diff
changeset
|
33 void Join(); |
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
29
diff
changeset
|
34 void Join(int timeout); |
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
29
diff
changeset
|
35 |
25 | 36 } |
37 } |