comparison Implab/SyncContextPromise.cs @ 119:2573b562e328 v2

Promises rewritten, added improved version of AsyncQueue
author cin
date Sun, 11 Jan 2015 19:13:02 +0300
parents d4e38929ce36
children f75cfa58e3d4
comparison
equal deleted inserted replaced
118:e046a94eecb1 119:2573b562e328
7 public SyncContextPromise(SynchronizationContext context) { 7 public SyncContextPromise(SynchronizationContext context) {
8 Safe.ArgumentNotNull(context, "context"); 8 Safe.ArgumentNotNull(context, "context");
9 m_context = context; 9 m_context = context;
10 } 10 }
11 11
12 public SyncContextPromise(SynchronizationContext context, IPromise parent) 12 protected override void SignalSuccess(IDeferred<T> handler) {
13 : base(parent) { 13 m_context.Post(x => base.SignalSuccess(handler), null);
14 Safe.ArgumentNotNull(context, "context");
15 m_context = context;
16 } 14 }
17 protected override void InvokeHandler(AbstractHandler handler) { 15
18 m_context.Post(x => base.InvokeHandler(handler),null); 16 protected override void SignalError(IDeferred<T> handler, System.Exception error) {
17 m_context.Post(x => base.SignalError(handler, error), null);
18 }
19
20 protected override void SignalCancelled(IDeferred<T> handler) {
21 m_context.Post(x => base.SignalCancelled(handler), null);
19 } 22 }
20 } 23 }
21 } 24 }
22 25