comparison Implab/FailedPromise.cs @ 242:cbe10ac0731e v3

Working on promises
author cin
date Wed, 24 Jan 2018 03:03:21 +0300
parents 4d9830a9bbb8
children
comparison
equal deleted inserted replaced
240:fa6cbf4d8841 242:cbe10ac0731e
51 public IPromise<T> Cast<T>() { 51 public IPromise<T> Cast<T>() {
52 return (IPromise<T>)this; 52 return (IPromise<T>)this;
53 } 53 }
54 54
55 public void Join() { 55 public void Join() {
56 throw new TargetInvocationException(Error); 56 throw new TargetInvocationException(RejectReason);
57 } 57 }
58 58
59 public void Join(int timeout) { 59 public void Join(int timeout) {
60 throw new TargetInvocationException(Error); 60 throw new TargetInvocationException(RejectReason);
61 } 61 }
62 62
63 public virtual Type PromiseType { 63 public virtual Type ResultType {
64 get { 64 get {
65 return typeof(void); 65 return typeof(void);
66 } 66 }
67 } 67 }
68 68
69 public bool IsResolved { 69 public bool IsFulfilled {
70 get { 70 get {
71 return true; 71 return true;
72 } 72 }
73 } 73 }
74 74
76 get { 76 get {
77 return false; 77 return false;
78 } 78 }
79 } 79 }
80 80
81 public Exception Error { 81 public Exception RejectReason {
82 get { 82 get {
83 return m_error; 83 return m_error;
84 } 84 }
85 } 85 }
86 86