Mercurial > pub > ImplabNet
comparison Implab/Components/RunnableComponent.cs @ 244:eee3e49dd1ff v3
working on promises
author | cin |
---|---|
date | Thu, 25 Jan 2018 19:09:16 +0300 |
parents | 5dc21f6a3222 |
children |
comparison
equal
deleted
inserted
replaced
243:b1e0ffdf3451 | 244:eee3e49dd1ff |
---|---|
270 /// </remarks> | 270 /// </remarks> |
271 protected virtual void OnResetState() { | 271 protected virtual void OnResetState() { |
272 throw new NotImplementedException(); | 272 throw new NotImplementedException(); |
273 } | 273 } |
274 | 274 |
275 IPromise InvokeAsync(Commands cmd, Func<IPromise> action, Action<IPromise, IDeferred> chain) { | 275 IPromise InvokeAsync(Commands cmd, Func<IPromise> action, Action<IPromise, IResolvable> chain) { |
276 IPromise promise = null; | 276 IPromise promise = null; |
277 IPromise prev; | 277 IPromise prev; |
278 | 278 |
279 var task = new ActionChainTask(action, null, null, true); | 279 var task = new ActionChainTask(action, null, null, true); |
280 | 280 |
342 /// <summary> | 342 /// <summary> |
343 /// Stops the current operation if one exists. | 343 /// Stops the current operation if one exists. |
344 /// </summary> | 344 /// </summary> |
345 /// <param name="current">Current.</param> | 345 /// <param name="current">Current.</param> |
346 /// <param name="stop">Stop.</param> | 346 /// <param name="stop">Stop.</param> |
347 protected virtual void StopPending(IPromise current, IDeferred stop) { | 347 protected virtual void StopPending(IPromise current, IResolvable stop) { |
348 if (current == null) { | 348 if (current == null) { |
349 stop.Resolve(); | 349 stop.Resolve(); |
350 } else { | 350 } else { |
351 // связваем текущую операцию с операцией остановки | 351 // связваем текущую операцию с операцией остановки |
352 current.On( | 352 current.On( |