Mercurial > pub > ImplabNet
view Implab/ActionChainTask.cs @ 157:948c015a9011 v2
sync
| author | cin | 
|---|---|
| date | Thu, 18 Feb 2016 11:03:47 +0300 | 
| parents | eb793fbbe4ea | 
| children | 822aab37b107 | 
line wrap: on
 line source
using System; namespace Implab { public class ActionChainTask : ActionChainTaskBase, IDeferred { readonly Func<IPromise> m_task; public ActionChainTask(Func<IPromise> task, Func<Exception, IPromise> error, Func<Exception, IPromise> cancel, bool autoCancellable) : base(error,cancel, autoCancellable) { m_task = task; } public void Resolve() { if (m_task != null && LockCancelation()) { try { var p = m_task(); p.On(SetResult, HandleErrorInternal, SetCancelled); CancellationRequested(p.Cancel); } catch(Exception err) { HandleErrorInternal(err); } } } } }
