##// END OF EJS Templates
working on promises
working on promises

File last commit:

r244:eee3e49dd1ff v3
r245:b904e0a3ba72 v3
Show More
ActionTask.cs
22 lines | 626 B | text/x-csharp | CSharpLexer
cin
RC: cancellation support for promises + tests
r145 using System;
namespace Implab {
cin
working on promises
r244 public class ActionTask : ActionTaskBase, IResolvable {
cin
RC: cancellation support for promises + tests
r145 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) {
cin
fixed promise chaining behavior, the error handler doesn't handle result or cancellation handlers exceptions these exceptions are propagated to the next handlers.
r196 SetErrorInternal(err);
cin
RC: cancellation support for promises + tests
r145 }
}
}
}
}