diff Implab/IDeferred.cs @ 240:fa6cbf4d8841 v3

refactoring, moving to dotnercore, simplifying promises
author cin
date Tue, 23 Jan 2018 19:39:21 +0300
parents 706fccb85524
children
line wrap: on
line diff
--- a/Implab/IDeferred.cs	Wed Dec 13 19:54:45 2017 +0300
+++ b/Implab/IDeferred.cs	Tue Jan 23 19:39:21 2018 +0300
@@ -4,7 +4,7 @@
     /// <summary>
     /// Deferred result, usually used by asynchronous services as the service part of the promise.
     /// </summary>
-    public interface IDeferred : ICancellationToken {
+    public interface IDeferred {
 
         void Resolve();
 
@@ -19,6 +19,13 @@
         /// <see cref="PromiseTransientException.InnerException"> is used as the reason to reject promise.
         /// </remarks>
         void Reject(Exception error);
+
+        /// <summary>
+        /// Marks current instance as cencelled with the specified reason.
+        /// </summary>
+        /// <param name="reason">The reason for the operation cancellation,
+        /// if not specified the new <see cref="OperationCanceledException"> will be created</param>
+        void SetCancelled(Exception reason);
     }
 }