##// END OF EJS Templates
refactoring complete, JSONParser rewritten
refactoring complete, JSONParser rewritten

File last commit:

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