comparison Implab/SyncContextPromise.cs @ 145:706fccb85524 v2

RC: cancellation support for promises + tests
author cin
date Sun, 08 Mar 2015 02:52:27 +0300
parents f75cfa58e3d4
children 97fbbf816844
comparison
equal deleted inserted replaced
144:8c0b95069066 145:706fccb85524
8 public SyncContextPromise(SynchronizationContext context) { 8 public SyncContextPromise(SynchronizationContext context) {
9 Safe.ArgumentNotNull(context, "context"); 9 Safe.ArgumentNotNull(context, "context");
10 m_context = context; 10 m_context = context;
11 } 11 }
12 12
13 protected override void SignalSuccess(IDeferred<T> handler) { 13 protected override void SignalSuccess(Promise<T>.HandlerDescriptor handler) {
14 m_context.Post(x => base.SignalSuccess(handler), null); 14 m_context.Post(x => base.SignalSuccess(handler), null);
15 } 15 }
16 16
17 protected override void SignalError(IDeferred<T> handler, Exception error) { 17 protected override void SignalError(Promise<T>.HandlerDescriptor handler, Exception error) {
18 m_context.Post(x => base.SignalError(handler, error), null); 18 m_context.Post(x => base.SignalError(handler, error), null);
19 } 19 }
20 20
21 protected override void SignalCancelled(IDeferred<T> handler, Exception reason) { 21 protected override void SignalCancelled(Promise<T>.HandlerDescriptor handler, Exception reason) {
22 m_context.Post(x => base.SignalCancelled(handler, reason), null); 22 m_context.Post(x => base.SignalCancelled(handler, reason), null);
23 } 23 }
24 } 24 }
25 } 25 }
26 26