##// END OF EJS Templates
minor changes
minor changes

File last commit:

r145:706fccb85524 v2
r146:e03ccec4a08d v2
Show More
ActionChainTaskT.cs
23 lines | 637 B | text/x-csharp | CSharpLexer
/ Implab / ActionChainTaskT.cs
cin
RC: cancellation support for promises + tests
r145 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);
}
}
}
}
}