##// END OF EJS Templates
Added ResetState to RunnableComponent to reset in case of failure...
Added ResetState to RunnableComponent to reset in case of failure Added StateChanged event to IRunnable Renamed Promise.SUCCESS -> Promise.Success Added Promise.FromException Renamed Bundle -> PromiseAll in PromiseExtensions

File last commit:

r196:40d7fed4a09e default
r205:8200ab154c8a v2
Show More
ActionTaskT.cs
22 lines | 648 B | text/x-csharp | CSharpLexer
cin
RC: cancellation support for promises + tests
r145 using System;
namespace Implab {
public class ActionTask<T> : ActionTaskBase, IDeferred<T> {
readonly Action<T> m_task;
cin
fixed promises cancellation
r149 public ActionTask(Action<T> 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(T value) {
if (m_task != null && LockCancelation()) {
try {
m_task(value);
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 }
}
}
}
}