##// END OF EJS Templates
Слияние с ref20160224
Слияние с ref20160224

File last commit:

r187:dd4a3590f9c6 ref20160224
r190:1c2a16d071a7 merge v2
Show More
FuncTaskT.cs
24 lines | 797 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));
cin
Reworked cancelation handling, if the cancel handler isn't specified the OperationCanceledException will be handled by the error handler...
r187 } catch(OperationCanceledException reason) {
HandleCancelInternal(reason);
} catch(Exception err) {
cin
DRAFT: refactoring
r144 HandleErrorInternal(err);
}
}
}
}
}