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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
1 using System;
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
2 using System.Collections.Generic;
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
3 using System.Linq;
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
4 using System.Text;
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
5
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
6 namespace Implab
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
7 {
25
9bf5b23650c9 refactoring
cin
parents: 19
diff changeset
8 public interface IPromise<T>: IPromiseBase
7
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
9 {
26
f0bf98e4d22c refactoring
cin
parents: 25
diff changeset
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
9bf5b23650c9 refactoring
cin
parents: 19
diff changeset
13
26
f0bf98e4d22c refactoring
cin
parents: 25
diff changeset
14 IPromise<T> Then(ResultHandler<T> success, ErrorHandler error);
f0bf98e4d22c refactoring
cin
parents: 25
diff changeset
15 IPromise<T> Then(ResultHandler<T> success, ErrorHandler<T> error);
f0bf98e4d22c refactoring
cin
parents: 25
diff changeset
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
f0bf98e4d22c refactoring
cin
parents: 25
diff changeset
18 IPromise<T> Error(ErrorHandler<T> error);
25
9bf5b23650c9 refactoring
cin
parents: 19
diff changeset
19
26
f0bf98e4d22c refactoring
cin
parents: 25
diff changeset
20 IPromise<T2> Map<T2>(ResultMapper<T,T2> mapper, ErrorHandler error);
f0bf98e4d22c refactoring
cin
parents: 25
diff changeset
21 IPromise<T2> Map<T2>(ResultMapper<T, T2> mapper);
7
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
22
26
f0bf98e4d22c refactoring
cin
parents: 25
diff changeset
23 IPromise<T2> Chain<T2>(ChainedOperation<T, T2> chained, ErrorHandler error);
f0bf98e4d22c refactoring
cin
parents: 25
diff changeset
24 IPromise<T2> Chain<T2>(ChainedOperation<T, T2> chained);
f0bf98e4d22c refactoring
cin
parents: 25
diff changeset
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
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
29
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
30 }
7ea9363fef6c inital progress handling
cin
parents:
diff changeset
31 }