##// END OF EJS Templates
Added awaiters to promises...
Added awaiters to promises Added static methods to Promise Resolve, Reject, All. Updated promise helpers

File last commit:

r248:5cb4826c2c2a v3
r248:5cb4826c2c2a v3
Show More
PromiseExtensions.cs
131 lines | 6.1 KiB | text/x-csharp | CSharpLexer
/ Implab / PromiseExtensions.cs
cin
promises refactoring
r72 using System.Threading;
cin
major refactoring, added tasks support
r75 using System;
cin
minor fixes
r109 using Implab.Diagnostics;
cin
Promises rewritten, added improved version of AsyncQueue
r119 using System.Collections.Generic;
cin
Added awaiters to promises...
r248 using System.Linq;
cin
promises refactoring
r72 namespace Implab {
public static class PromiseExtensions {
cin
Added awaiters to promises...
r248 public static IPromise Then(this IPromise that, Action fulfilled, Action<Exception> rejected) {
var reaction = new PromiseActionReaction(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
code cleanup...
r101 }
cin
Added awaiters to promises...
r248 public static IPromise Then(this IPromise that, Action fulfilled, Func<Exception, IPromise> rejected) {
var reaction = new PromiseActionReaction(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
added Safe.DispatchEvent() a legacy equivalent for '?.Invoke()'...
r207 }
cin
Added awaiters to promises...
r248 public static IPromise Then(this IPromise that, Func<IPromise> fulfilled, Action<Exception> rejected) {
var reaction = new PromiseActionReaction(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
major refactoring, added tasks support
r75 }
cin
added promise timeout helper
r110
cin
Added awaiters to promises...
r248 public static IPromise Then(this IPromise that, Func<IPromise> fulfilled, Func<Exception, IPromise> rejected) {
var reaction = new PromiseActionReaction(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
added promise timeout helper
r110 }
cin
Promises rewritten, added improved version of AsyncQueue
r119
cin
Added awaiters to promises...
r248 public static IPromise Then<T>(this IPromise<T> that, Action<T> fulfilled, Action<Exception> rejected) {
var reaction = new PromiseActionReaction<T>(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
Added ResetState to RunnableComponent to reset in case of failure...
r205 }
cin
Added awaiters to promises...
r248 public static IPromise Then<T>(this IPromise<T> that, Action<T> fulfilled, Func<Exception, IPromise> rejected) {
var reaction = new PromiseActionReaction<T>(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
RunnableComponent.Dispose(bool,Exception) changed to standart Dispose(bool)...
r208 }
cin
Added awaiters to promises...
r248 public static IPromise Then<T>(this IPromise<T> that, Func<T, IPromise> fulfilled, Action<Exception> rejected) {
var reaction = new PromiseActionReaction<T>(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
major update, added Drain mathod to AsyncQueue class
r124 }
cin
RC: cancellation support for promises + tests
r145
cin
Added awaiters to promises...
r248 public static IPromise Then<T>(this IPromise<T> that, Func<T, IPromise> fulfilled, Func<Exception, IPromise> rejected) {
var reaction = new PromiseActionReaction<T>(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
}
cin
RC: cancellation support for promises + tests
r145
cin
Added awaiters to promises...
r248 public static IPromise<Tout> Then<Tout>(this IPromise that, Func<Tout> fulfilled, Func<Exception, Tout> rejected) {
var reaction = new PromiseFuncReaction<Tout>(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
RC: cancellation support for promises + tests
r145 }
cin
Added awaiters to promises...
r248 public static IPromise<Tout> Then<Tout>(this IPromise that, Func<Tout> fulfilled, Func<Exception, IPromise<Tout>> rejected) {
var reaction = new PromiseFuncReaction<Tout>(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
RC: cancellation support for promises + tests
r145 }
cin
Added awaiters to promises...
r248 public static IPromise<Tout> Then<Tout>(this IPromise that, Func<IPromise<Tout>> fulfilled, Func<Exception, Tout> rejected) {
var reaction = new PromiseFuncReaction<Tout>(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
added Safe.DispatchEvent() a legacy equivalent for '?.Invoke()'...
r207 }
cin
Added awaiters to promises...
r248 public static IPromise<Tout> Then<Tout>(this IPromise that, Func<IPromise<Tout>> fulfilled, Func<Exception, IPromise<Tout>> rejected) {
var reaction = new PromiseFuncReaction<Tout>(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
RC: cancellation support for promises + tests
r145 }
cin
Added awaiters to promises...
r248 public static IPromise<Tout> Then<Tin, Tout>(this IPromise<Tin> that, Func<Tin, Tout> fulfilled, Func<Exception, Tout> rejected) {
var reaction = new PromiseFuncReaction<Tin, Tout>(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
added Safe.DispatchEvent() a legacy equivalent for '?.Invoke()'...
r207 }
cin
Added awaiters to promises...
r248 public static IPromise<Tout> Then<Tin, Tout>(this IPromise<Tin> that, Func<Tin, Tout> fulfilled, Func<Exception, IPromise<Tout>> rejected) {
var reaction = new PromiseFuncReaction<Tin, Tout>(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
added Safe.DispatchEvent() a legacy equivalent for '?.Invoke()'...
r207 }
cin
Added awaiters to promises...
r248 public static IPromise<Tout> Then<Tin, Tout>(this IPromise<Tin> that, Func<Tin, IPromise<Tout>> fulfilled, Func<Exception, Tout> rejected) {
var reaction = new PromiseFuncReaction<Tin, Tout>(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
added Safe.DispatchEvent() a legacy equivalent for '?.Invoke()'...
r207 }
cin
Added awaiters to promises...
r248 public static IPromise<Tout> Then<Tin, Tout>(this IPromise<Tin> that, Func<Tin, IPromise<Tout>> fulfilled, Func<Exception, IPromise<Tout>> rejected) {
var reaction = new PromiseFuncReaction<Tin, Tout>(fulfilled, rejected, Promise.DefaultDispatcher);
that.Then(reaction);
return reaction.Promise;
cin
RC: cancellation support for promises + tests
r145 }
cin
Added awaiters to promises...
r248 public static IPromise Catch(this IPromise that, Action<Exception> rejected) {
return Then(that, null, rejected);
cin
RC: cancellation support for promises + tests
r145 }
cin
Added awaiters to promises...
r248 public static IPromise Catch(this IPromise that, Func<Exception, IPromise> rejected) {
return Then(that, null, rejected);
cin
RC: cancellation support for promises + tests
r145 }
cin
Added awaiters to promises...
r248 public static IPromise<Tout> Catch<Tout>(this IPromise that, Func<Exception, Tout> rejected) {
return Then(that, (Func<Tout>)null, rejected);
cin
RC: cancellation support for promises + tests
r145 }
cin
Added awaiters to promises...
r248 public static IPromise<Tout> Catch<Tout>(this IPromise that, Func<Exception, IPromise<Tout>> rejected) {
return Then(that, (Func<Tout>)null, rejected);
}
cin
major refactoring, added tasks support
r75
cin
Added awaiters to promises...
r248 public static IPromise<Tout> Catch<Tin, Tout>(this IPromise<Tin> that, Func<Exception, Tout> rejected) {
return Then(that, (Func<Tin, Tout>)null, rejected);
}
cin
RunnableComponent.Dispose(bool,Exception) changed to standart Dispose(bool)...
r208
cin
Added awaiters to promises...
r248 public static IPromise<Tout> Catch<Tin, Tout>(this IPromise<Tin> that, Func<Exception, IPromise<Tout>> rejected) {
return Then(that, (Func<Tin, Tout>)null, rejected);
}
cin
promises refactoring
r72 }
}