##// END OF EJS Templates
fixed error handling for chained actions
fixed error handling for chained actions

File last commit:

r196:40d7fed4a09e default
r198:b305c678923a default
Show More
FuncTask.cs
23 lines | 632 B | text/x-csharp | CSharpLexer
using System;
using System.Threading;
namespace Implab {
public class FuncTask<T> : FuncTaskBase<T>, IDeferred {
readonly Func<T> m_task;
public FuncTask(Func<T> task, Func<Exception, T> error, Func<Exception, T> cancel, bool autoCancellable) : base(error, cancel, autoCancellable) {
m_task = task;
}
public void Resolve() {
if (m_task != null && LockCancelation()) {
try {
SetResult(m_task());
} catch(Exception err) {
SetErrorInternal(err);
}
}
}
}
}