using System; namespace Implab { public class FuncChainTask : FuncChainTaskBase, IDeferred { readonly Func> m_task; public FuncChainTask(Func> task, Func> error, Func> cancel, bool autoCancellable) : base(error, cancel, autoCancellable) { m_task = task; } public void Resolve() { if (m_task != null && LockCancelation()) { try { var operation = m_task(); operation.On(SetResult, HandleErrorInternal, HandleCancelInternal); CancellationRequested(operation.Cancel); } catch (Exception err) { SetErrorInternal(err); } } } } }