##// END OF EJS Templates
sync
sync

File last commit:

r145:706fccb85524 v2
r147:25cdef49102f v2
Show More
ActionTask.cs
22 lines | 588 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;
public ActionTask(Action task, Action<Exception> error, Action<Exception> cancel) : base(error,cancel) {
m_task = task;
}
public void Resolve() {
if (m_task != null && LockCancelation()) {
try {
m_task();
SetResult();
} catch(Exception err) {
HandleErrorInternal(err);
}
}
}
}
}