##// END OF EJS Templates
sync
sync

File last commit:

r145:706fccb85524 v2
r147:25cdef49102f v2
Show More
ActionChainTaskT.cs
23 lines | 637 B | text/x-csharp | CSharpLexer
using System;
namespace Implab {
public class ActionChainTask<T> : ActionChainTaskBase, IDeferred<T> {
readonly Func<T, IPromise> m_task;
public ActionChainTask(Func<T, IPromise> task, Func<Exception, IPromise> error, Func<Exception, IPromise> cancel) : base(error,cancel) {
m_task = task;
}
public void Resolve(T value) {
if (m_task != null && LockCancelation()) {
try {
Observe(m_task(value));
} catch(Exception err) {
HandleErrorInternal(err);
}
}
}
}
}