##// END OF EJS Templates
RC: cancellation support for promises + tests
RC: cancellation support for promises + tests

File last commit:

r145:706fccb85524 v2
r145:706fccb85524 v2
Show More
ActionChainTask.cs
23 lines | 613 B | text/x-csharp | CSharpLexer
using System;
namespace Implab {
public class ActionChainTask : ActionChainTaskBase, IDeferred {
readonly Func<IPromise> m_task;
public ActionChainTask(Func<IPromise> task, Func<Exception, IPromise> error, Func<Exception, IPromise> cancel) : base(error,cancel) {
m_task = task;
}
public void Resolve() {
if (m_task != null && LockCancelation()) {
try {
Observe(m_task());
} catch(Exception err) {
HandleErrorInternal(err);
}
}
}
}
}