##// END OF EJS Templates
Added support for 'await' operator to promises
Added support for 'await' operator to promises

File last commit:

r149:eb793fbbe4ea v2
r151:ec91a6dfa5b3 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);
}
}
}
}
}