##// END OF EJS Templates
Refactoring of the IPromise<T> interface...
Refactoring of the IPromise<T> interface Added tests

File last commit:

r72:d67b95eddaf4 v2
r76:c761fc982e1d v2
Show More
SyncContextPromise.cs
22 lines | 720 B | text/x-csharp | CSharpLexer
/ Implab / SyncContextPromise.cs
cin
promises refactoring
r72 using System.Threading;
namespace Implab {
public class SyncContextPromise<T> : Promise<T> {
readonly SynchronizationContext m_context;
public SyncContextPromise(SynchronizationContext context) {
Safe.ArgumentNotNull(context, "context");
m_context = context;
}
public SyncContextPromise(SynchronizationContext context, IPromise parent, bool cancellable)
: base(parent, cancellable) {
Safe.ArgumentNotNull(context, "context");
m_context = context;
}
protected override void InvokeHandler(HandlerDescriptor handler) {
m_context.Post(x => base.InvokeHandler(handler),null);
}
}
}