annotate Implab/IResolvable.cs @ 244:eee3e49dd1ff v3

working on promises
author cin
date Thu, 25 Jan 2018 19:09:16 +0300
parents
children b904e0a3ba72
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
244
eee3e49dd1ff working on promises
cin
parents:
diff changeset
1 using System;
eee3e49dd1ff working on promises
cin
parents:
diff changeset
2
eee3e49dd1ff working on promises
cin
parents:
diff changeset
3 namespace Implab {
eee3e49dd1ff working on promises
cin
parents:
diff changeset
4 /// <summary>
eee3e49dd1ff working on promises
cin
parents:
diff changeset
5 /// Deferred result, usually used by asynchronous services as the service part of the promise.
eee3e49dd1ff working on promises
cin
parents:
diff changeset
6 /// </summary>
eee3e49dd1ff working on promises
cin
parents:
diff changeset
7 public interface IResolvable {
eee3e49dd1ff working on promises
cin
parents:
diff changeset
8
eee3e49dd1ff working on promises
cin
parents:
diff changeset
9 void Resolve();
eee3e49dd1ff working on promises
cin
parents:
diff changeset
10
eee3e49dd1ff working on promises
cin
parents:
diff changeset
11 void Resolve(IPromise thenable);
eee3e49dd1ff working on promises
cin
parents:
diff changeset
12
eee3e49dd1ff working on promises
cin
parents:
diff changeset
13 /// <summary>
eee3e49dd1ff working on promises
cin
parents:
diff changeset
14 /// Reject the promise with the specified error.
eee3e49dd1ff working on promises
cin
parents:
diff changeset
15 /// </summary>
eee3e49dd1ff working on promises
cin
parents:
diff changeset
16 /// <param name="error">The reason why the promise is rejected.</param>
eee3e49dd1ff working on promises
cin
parents:
diff changeset
17 /// <remarks>
eee3e49dd1ff working on promises
cin
parents:
diff changeset
18 /// Some exceptions are treated in a special case:
eee3e49dd1ff working on promises
cin
parents:
diff changeset
19 /// <see cref="OperationCanceledException"/> is interpreted as call to <see cref="Cancel()"/> method,
eee3e49dd1ff working on promises
cin
parents:
diff changeset
20 /// and <see cref="PromiseTransientException"/> is always unwrapped and its
eee3e49dd1ff working on promises
cin
parents:
diff changeset
21 /// <see cref="PromiseTransientException.InnerException"> is used as the reason to reject promise.
eee3e49dd1ff working on promises
cin
parents:
diff changeset
22 /// </remarks>
eee3e49dd1ff working on promises
cin
parents:
diff changeset
23 void Reject(Exception error);
eee3e49dd1ff working on promises
cin
parents:
diff changeset
24 }
eee3e49dd1ff working on promises
cin
parents:
diff changeset
25 }
eee3e49dd1ff working on promises
cin
parents:
diff changeset
26