##// END OF EJS Templates
added Safe.DispatchEvent() a legacy equivalent for '?.Invoke()'...
added Safe.DispatchEvent() a legacy equivalent for '?.Invoke()' added Safe.Dispose(IEnumerable) added PromiseExtensions.CancellationPoint to add a cancellation point to the chain of promises added IPromise<T> PromiseExtensions.Then<T>(this IPromise<T> that, Action<T> success) overloads added PromiseExtensions.Error() overloads to handle a error or(and) a cancellation

File last commit:

r205:8200ab154c8a v2
r207:558f34b2fb50 v2
Show More
Promise.cs
25 lines | 544 B | text/x-csharp | CSharpLexer
cin
Promises rewritten, added improved version of AsyncQueue
r119 using System;
cin
DRAFT: refactoring
r144 using Implab.Parallels;
cin
Promises rewritten, added improved version of AsyncQueue
r119
namespace Implab {
cin
DRAFT: refactoring
r144 public class Promise : AbstractPromise, IDeferred {
cin
Added ResetState to RunnableComponent to reset in case of failure...
r205 public static readonly IPromise Success;
cin
Promises rewritten, added improved version of AsyncQueue
r119
cin
DRAFT: refactoring
r144 static Promise() {
cin
Added ResetState to RunnableComponent to reset in case of failure...
r205 Success = new SuccessPromise();
cin
Promises rewritten, added improved version of AsyncQueue
r119 }
public void Resolve() {
cin
DRAFT: refactoring
r144 SetResult();
cin
Promises rewritten, added improved version of AsyncQueue
r119 }
public void Reject(Exception error) {
SetError(error);
cin
Added ResetState to RunnableComponent to reset in case of failure...
r205 }
public static IPromise FromException(Exception exception) {
return new FailedPromise(exception);
}
cin
Promises rewritten, added improved version of AsyncQueue
r119 }
}