diff Implab/IPromise.cs @ 18:0c924dff5498

Слияние с promises
author cin
date Fri, 08 Nov 2013 01:27:04 +0400
parents eb418ba8275b
children e3935fdf59a2
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Implab/IPromise.cs	Fri Nov 08 01:27:04 2013 +0400
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Implab
+{
+    public interface IPromise: ICancellable
+    {
+        /// <summary>
+        /// Check whereather the promise has no more than one dependent promise.
+        /// </summary>
+        bool IsExclusive
+        {
+            get;
+        }
+
+        /// <summary>
+        /// The current state of the promise.
+        /// </summary>
+        PromiseState State
+        {
+            get;
+        }
+
+        /// <summary>
+        /// Registers handler for the case when the promise is cencelled. If the promise already cancelled the
+        /// handler will be invoked immediatelly.
+        /// </summary>
+        /// <param name="handler">The handler</param>
+        void HandleCancelled(Action handler);
+    }
+}