Mercurial > pub > ImplabNet
comparison Implab/IPromiseT.cs @ 75:4439140706d0 v2
major refactoring, added tasks support
author | cin |
---|---|
date | Wed, 10 Sep 2014 11:17:37 +0400 |
parents | d67b95eddaf4 |
children | c761fc982e1d |
comparison
equal
deleted
inserted
replaced
74:c4140283575c | 75:4439140706d0 |
---|---|
1 using System; | 1 using System; |
2 using System.Collections.Generic; | 2 using System.Collections.Generic; |
3 using System.Linq; | 3 using System.Linq; |
4 using System.Text; | 4 using System.Text; |
5 | 5 |
6 namespace Implab | 6 namespace Implab { |
7 { | 7 public interface IPromise<T>: IPromise { |
8 public interface IPromise<T>: IPromise | |
9 { | |
10 | 8 |
11 new T Join(); | 9 new T Join(); |
10 | |
12 new T Join(int timeout); | 11 new T Join(int timeout); |
13 | 12 |
13 IPromise<T> Then(ResultHandler<T> success, ErrorHandler<T> error, Action cancel); | |
14 | |
14 IPromise<T> Then(ResultHandler<T> success, ErrorHandler<T> error); | 15 IPromise<T> Then(ResultHandler<T> success, ErrorHandler<T> error); |
16 | |
15 IPromise<T> Then(ResultHandler<T> success); | 17 IPromise<T> Then(ResultHandler<T> success); |
18 | |
19 void Last(ResultHandler<T> success, ErrorHandler error, Action cancel); | |
20 void Last(ResultHandler<T> success, ErrorHandler error); | |
21 void Last(ResultHandler<T> success); | |
22 | |
16 IPromise<T> Error(ErrorHandler<T> error); | 23 IPromise<T> Error(ErrorHandler<T> error); |
17 | 24 |
18 IPromise<T2> Map<T2>(ResultMapper<T,T2> mapper, ErrorHandler<T> error); | 25 IPromise<T2> Then<T2>(ResultMapper<T,T2> mapper, ErrorHandler<T> error); |
19 IPromise<T2> Map<T2>(ResultMapper<T, T2> mapper); | |
20 | 26 |
21 IPromise<T2> Chain<T2>(ChainedOperation<T, T2> chained, ErrorHandler<T> error); | 27 IPromise<T2> Then<T2>(ResultMapper<T,T2> mapper); |
22 IPromise<T2> Chain<T2>(ChainedOperation<T, T2> chained); | 28 |
29 IPromise<T2> Then<T2>(ChainedOperation<T, T2> chained, ErrorHandler<T> error); | |
30 | |
31 IPromise<T2> Then<T2>(ChainedOperation<T, T2> chained); | |
23 | 32 |
24 new IPromise<T> Cancelled(Action handler); | 33 new IPromise<T> Cancelled(Action handler); |
34 | |
25 new IPromise<T> Finally(Action handler); | 35 new IPromise<T> Finally(Action handler); |
26 new IPromise<T> Anyway(Action handler); | |
27 | |
28 } | 36 } |
29 } | 37 } |