comparison Implab/SyncContextPromise.cs @ 156:97fbbf816844 v2

Promises: SignalXXX methods merged into SignalHandler method. Components: RunnableComponent In progress
author cin
date Mon, 15 Feb 2016 04:22:15 +0300
parents 706fccb85524
children 3eb3255d8cc5
comparison
equal deleted inserted replaced
155:037df317f126 156:97fbbf816844
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(Promise<T>.HandlerDescriptor handler) { 13 protected override void SignalHandler(HandlerDescriptor handler, int signal) {
14 m_context.Post(x => base.SignalSuccess(handler), null); 14 m_context.Post(x => base.SignalHandler(handler, signal), null);
15 }
16
17 protected override void SignalError(Promise<T>.HandlerDescriptor handler, Exception error) {
18 m_context.Post(x => base.SignalError(handler, error), null);
19 }
20
21 protected override void SignalCancelled(Promise<T>.HandlerDescriptor handler, Exception reason) {
22 m_context.Post(x => base.SignalCancelled(handler, reason), null);
23 } 15 }
24 } 16 }
25 } 17 }
26 18