##// END OF EJS Templates
added ICancellable.Cancel(Exception) to allow specify the reason of cancellation
added ICancellable.Cancel(Exception) to allow specify the reason of cancellation

File last commit:

r138:f75cfa58e3d4 v2
r138:f75cfa58e3d4 v2
Show More
SyncContextPromise.cs
26 lines | 838 B | text/x-csharp | CSharpLexer
/ Implab / SyncContextPromise.cs
cin
promises refactoring
r72 using System.Threading;
cin
added ICancellable.Cancel(Exception) to allow specify the reason of cancellation
r138 using System;
cin
promises refactoring
r72
namespace Implab {
public class SyncContextPromise<T> : Promise<T> {
readonly SynchronizationContext m_context;
public SyncContextPromise(SynchronizationContext context) {
Safe.ArgumentNotNull(context, "context");
m_context = context;
}
cin
Promises rewritten, added improved version of AsyncQueue
r119 protected override void SignalSuccess(IDeferred<T> handler) {
m_context.Post(x => base.SignalSuccess(handler), null);
cin
promises refactoring
r72 }
cin
Promises rewritten, added improved version of AsyncQueue
r119
cin
added ICancellable.Cancel(Exception) to allow specify the reason of cancellation
r138 protected override void SignalError(IDeferred<T> handler, Exception error) {
cin
Promises rewritten, added improved version of AsyncQueue
r119 m_context.Post(x => base.SignalError(handler, error), null);
}
cin
added ICancellable.Cancel(Exception) to allow specify the reason of cancellation
r138 protected override void SignalCancelled(IDeferred<T> handler, Exception reason) {
m_context.Post(x => base.SignalCancelled(handler, reason), null);
cin
promises refactoring
r72 }
}
}