244
|
1 using System;
|
|
2
|
|
3 namespace Implab {
|
|
4 /// <summary>
|
|
5 /// Deferred result, usually used by asynchronous services as the service part of the promise.
|
|
6 /// </summary>
|
|
7 public interface IResolvable {
|
|
8
|
|
9 void Resolve();
|
|
10
|
|
11 /// <summary>
|
|
12 /// Reject the promise with the specified error.
|
|
13 /// </summary>
|
|
14 /// <param name="error">The reason why the promise is rejected.</param>
|
|
15 /// <remarks>
|
|
16 /// Some exceptions are treated in a special case:
|
|
17 /// <see cref="OperationCanceledException"/> is interpreted as call to <see cref="Cancel()"/> method,
|
|
18 /// and <see cref="PromiseTransientException"/> is always unwrapped and its
|
|
19 /// <see cref="PromiseTransientException.InnerException"> is used as the reason to reject promise.
|
|
20 /// </remarks>
|
|
21 void Reject(Exception error);
|
|
22 }
|
|
23 }
|
|
24
|