##// END OF EJS Templates
DFA refactoring
DFA refactoring

File last commit:

r149:eb793fbbe4ea v2
r162:0526412bbb26 ref20160224
Show More
FuncTaskT.cs
22 lines | 686 B | text/x-csharp | CSharpLexer
cin
DRAFT: refactoring
r144 using System;
namespace Implab {
public class FuncTask<TArg, TResult> : FuncTaskBase<TResult>, IDeferred<TArg> {
readonly Func<TArg, TResult> m_task;
cin
fixed promises cancellation
r149 public FuncTask(Func<TArg, TResult> task, Func<Exception, TResult> error,Func<Exception, TResult> cancel, bool autoCancellable) : base(error,cancel, autoCancellable) {
cin
DRAFT: refactoring
r144 m_task = task;
}
public void Resolve(TArg value) {
if (m_task != null && LockCancelation()) {
try {
SetResult(m_task(value));
} catch (Exception err) {
HandleErrorInternal(err);
}
}
}
}
}