diff 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
line wrap: on
line diff
--- a/Implab/SyncContextPromise.cs	Sun Dec 28 16:09:03 2014 +0300
+++ b/Implab/SyncContextPromise.cs	Sun Jan 11 19:13:02 2015 +0300
@@ -9,13 +9,16 @@
             m_context = context;
         }
 
-        public SyncContextPromise(SynchronizationContext context, IPromise parent)
-            : base(parent) {
-            Safe.ArgumentNotNull(context, "context");
-            m_context = context;
+        protected override void SignalSuccess(IDeferred<T> handler) {
+            m_context.Post(x => base.SignalSuccess(handler), null);
         }
-        protected override void InvokeHandler(AbstractHandler handler) {
-            m_context.Post(x => base.InvokeHandler(handler),null);
+
+        protected override void SignalError(IDeferred<T> handler, System.Exception error) {
+            m_context.Post(x => base.SignalError(handler, error), null);
+        }
+
+        protected override void SignalCancelled(IDeferred<T> handler) {
+            m_context.Post(x => base.SignalCancelled(handler), null);
         }
     }
 }