7
|
1 using System;
|
|
2 using System.Collections.Generic;
|
|
3 using System.Linq;
|
|
4 using System.Text;
|
|
5
|
|
6 namespace Implab
|
|
7 {
|
12
|
8 public interface IPromise: ICancellable
|
7
|
9 {
|
|
10 /// <summary>
|
|
11 /// Check whereather the promise has no more than one dependent promise.
|
|
12 /// </summary>
|
|
13 bool IsExclusive
|
|
14 {
|
|
15 get;
|
|
16 }
|
|
17
|
|
18 /// <summary>
|
|
19 /// The current state of the promise.
|
|
20 /// </summary>
|
|
21 PromiseState State
|
|
22 {
|
|
23 get;
|
|
24 }
|
|
25
|
|
26 /// <summary>
|
10
|
27 /// Registers handler for the case when the promise is cencelled. If the promise already cancelled the
|
|
28 /// handler will be invoked immediatelly.
|
|
29 /// </summary>
|
|
30 /// <param name="handler">The handler</param>
|
|
31 void HandleCancelled(Action handler);
|
7
|
32 }
|
|
33 }
|