Mercurial > pub > ImplabNet
annotate Implab/IPromiseT.cs @ 130:671f60cd0250 v2
fixed Resove method bug when calling it on already cancelled promise
author | cin |
---|---|
date | Fri, 30 Jan 2015 17:07:17 +0300 |
parents | 2573b562e328 |
children | f75cfa58e3d4 |
rev | line source |
---|---|
66 | 1 using System; |
2 | |
75 | 3 namespace Implab { |
119
2573b562e328
Promises rewritten, added improved version of AsyncQueue
cin
parents:
106
diff
changeset
|
4 public interface IPromise<out T> : IPromise { |
66 | 5 |
6 new T Join(); | |
75 | 7 |
66 | 8 new T Join(int timeout); |
9 | |
119
2573b562e328
Promises rewritten, added improved version of AsyncQueue
cin
parents:
106
diff
changeset
|
10 IPromise<T> On(Action<T> success, Action<Exception> error, Action cancel); |
76 | 11 |
119
2573b562e328
Promises rewritten, added improved version of AsyncQueue
cin
parents:
106
diff
changeset
|
12 IPromise<T> On(Action<T> success, Action<Exception> error); |
76 | 13 |
119
2573b562e328
Promises rewritten, added improved version of AsyncQueue
cin
parents:
106
diff
changeset
|
14 IPromise<T> On(Action<T> success); |
76 | 15 |
119
2573b562e328
Promises rewritten, added improved version of AsyncQueue
cin
parents:
106
diff
changeset
|
16 new IPromise<T> On(Action handler, PromiseEventType events); |
2573b562e328
Promises rewritten, added improved version of AsyncQueue
cin
parents:
106
diff
changeset
|
17 |
2573b562e328
Promises rewritten, added improved version of AsyncQueue
cin
parents:
106
diff
changeset
|
18 IPromise<T2> Then<T2>(Func<T, T2> mapper, Func<Exception,T2> error, Func<T2> cancel); |
76 | 19 |
101 | 20 IPromise<T2> Then<T2>(Func<T, T2> mapper, Func<Exception,T2> error); |
76 | 21 |
101 | 22 IPromise<T2> Then<T2>(Func<T, T2> mapper); |
76 | 23 |
119
2573b562e328
Promises rewritten, added improved version of AsyncQueue
cin
parents:
106
diff
changeset
|
24 IPromise<T2> Chain<T2>(Func<T, IPromise<T2>> chained, Func<Exception,IPromise<T2>> error, Func<IPromise<T2>> cancel); |
76 | 25 |
101 | 26 IPromise<T2> Chain<T2>(Func<T, IPromise<T2>> chained, Func<Exception,IPromise<T2>> error); |
76 | 27 |
101 | 28 IPromise<T2> Chain<T2>(Func<T, IPromise<T2>> chained); |
75 | 29 |
119
2573b562e328
Promises rewritten, added improved version of AsyncQueue
cin
parents:
106
diff
changeset
|
30 IPromise<T2> Error<T2>(Func<Exception,T2> error); |
66 | 31 |
119
2573b562e328
Promises rewritten, added improved version of AsyncQueue
cin
parents:
106
diff
changeset
|
32 IPromise<T2> Cancelled<T2>(Func<T2> handler); |
66 | 33 } |
34 } |