##// END OF EJS Templates
fixed promises cancellation
fixed promises cancellation

File last commit:

r149:eb793fbbe4ea v2
r149:eb793fbbe4ea v2
Show More
ActionTask.cs
22 lines | 627 B | text/x-csharp | CSharpLexer
cin
RC: cancellation support for promises + tests
r145 using System;
namespace Implab {
public class ActionTask : ActionTaskBase, IDeferred {
readonly Action m_task;
cin
fixed promises cancellation
r149 public ActionTask(Action task, Action<Exception> error, Action<Exception> cancel, bool autoCancellable) : base(error,cancel, autoCancellable) {
cin
RC: cancellation support for promises + tests
r145 m_task = task;
}
public void Resolve() {
if (m_task != null && LockCancelation()) {
try {
m_task();
SetResult();
} catch(Exception err) {
HandleErrorInternal(err);
}
}
}
}
}