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

File last commit:

r187:dd4a3590f9c6 ref20160224
r192:f1da3afc3521 merge release v2.1 default
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);
}
}
}
}
}