##// 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
using System;
namespace Implab {
public class ActionTask : ActionTaskBase, IResolvable {
readonly Action m_task;
public ActionTask(Action task, Action<Exception> error, Action<Exception> cancel, bool autoCancellable) : base(error,cancel, autoCancellable) {
m_task = task;
}
public void Resolve() {
if (m_task != null && LockCancelation()) {
try {
m_task();
SetResult();
} catch(Exception err) {
SetErrorInternal(err);
}
}
}
}
}