Mercurial > pub > ImplabNet
annotate Implab/IPromise.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 | f0bf98e4d22c |
children | 790e8a997d30 |
rev | line source |
---|---|
7 | 1 using System; |
2 using System.Collections.Generic; | |
3 using System.Linq; | |
4 using System.Text; | |
5 | |
6 namespace Implab | |
7 { | |
25 | 8 public interface IPromise<T>: IPromiseBase |
7 | 9 { |
26 | 10 |
33
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
26
diff
changeset
|
11 new T Join(); |
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
26
diff
changeset
|
12 new T Join(int timeout); |
25 | 13 |
26 | 14 IPromise<T> Then(ResultHandler<T> success, ErrorHandler error); |
15 IPromise<T> Then(ResultHandler<T> success, ErrorHandler<T> error); | |
16 IPromise<T> Then(ResultHandler<T> success); | |
33
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
26
diff
changeset
|
17 new IPromise<T> Error(ErrorHandler error); |
26 | 18 IPromise<T> Error(ErrorHandler<T> error); |
25 | 19 |
26 | 20 IPromise<T2> Map<T2>(ResultMapper<T,T2> mapper, ErrorHandler error); |
21 IPromise<T2> Map<T2>(ResultMapper<T, T2> mapper); | |
7 | 22 |
26 | 23 IPromise<T2> Chain<T2>(ChainedOperation<T, T2> chained, ErrorHandler error); |
24 IPromise<T2> Chain<T2>(ChainedOperation<T, T2> chained); | |
25 | |
33
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
26
diff
changeset
|
26 new IPromise<T> Cancelled(Action handler); |
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
26
diff
changeset
|
27 new IPromise<T> Finally(Action handler); |
b255e4aeef17
removed the reference to the parent from the promise object this allows
cin
parents:
26
diff
changeset
|
28 new IPromise<T> Anyway(Action handler); |
7 | 29 |
30 } | |
31 } |