Mercurial > pub > ImplabNet
comparison Implab/AbstractPromiseT.cs @ 242:cbe10ac0731e v3
Working on promises
author | cin |
---|---|
date | Wed, 24 Jan 2018 03:03:21 +0300 |
parents | 86187b01c4e0 |
children |
comparison
equal
deleted
inserted
replaced
240:fa6cbf4d8841 | 242:cbe10ac0731e |
---|---|
82 } | 82 } |
83 } | 83 } |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 public Type PromiseType { | 87 public Type ResultType { |
88 get { | 88 get { |
89 return typeof(T); | 89 return typeof(T); |
90 } | 90 } |
91 } | 91 } |
92 | 92 |
165 return (IPromise<T2>)this; | 165 return (IPromise<T2>)this; |
166 } | 166 } |
167 | 167 |
168 #region implemented abstract members of AbstractPromise | 168 #region implemented abstract members of AbstractPromise |
169 | 169 |
170 protected override Signal GetResolveSignal() { | 170 protected override Signal GetFulfillSignal() { |
171 var signal = new Signal(); | 171 var signal = new Signal(); |
172 AddHandler(new HandlerDescriptor(signal.Set, PromiseEventType.All)); | 172 AddHandler(new HandlerDescriptor(signal.Set, PromiseEventType.All)); |
173 return signal; | 173 return signal; |
174 } | 174 } |
175 | 175 |
177 switch (signal) { | 177 switch (signal) { |
178 case SUCCEEDED_STATE: | 178 case SUCCEEDED_STATE: |
179 handler.SignalSuccess(m_result); | 179 handler.SignalSuccess(m_result); |
180 break; | 180 break; |
181 case REJECTED_STATE: | 181 case REJECTED_STATE: |
182 handler.SignalError(Error); | 182 handler.SignalError(RejectReason); |
183 break; | 183 break; |
184 case CANCELLED_STATE: | 184 case CANCELLED_STATE: |
185 handler.SignalCancel(CancellationReason); | 185 handler.SignalCancel(CancellationReason); |
186 break; | 186 break; |
187 default: | 187 default: |