annotate Implab/ResolvedPromise.cs @ 249:d82909310094 v3

Implab.Test moved to xunit Complete set of PromiseHelpers (Then, Catch, Finally) Removed obsolete types ICancellable, ICancellationToken
author cin
date Wed, 31 Jan 2018 11:28:38 +0300
parents 5cb4826c2c2a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
248
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
1 using System;
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
2
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
3 namespace Implab
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
4 {
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
5 public struct ResolvedPromise : IPromise {
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
6 public Type ResultType => typeof(void);
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
7
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
8 public bool IsResolved => true;
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
9
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
10 public bool IsRejected => false;
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
11
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
12 public bool IsFulfilled => true;
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
13
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
14 public Exception RejectReason => null;
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
15
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
16 public IPromise<T> Cast<T>() {
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
17 throw new InvalidCastException();
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
18 }
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
19
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
20 public void Join() {
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
21 }
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
22
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
23 public void Join(int timeout) {
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
24 }
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
25
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
26 public void Then(IResolvable next) {
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
27 next.Resolve();
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
28 }
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
29 }
5cb4826c2c2a Added awaiters to promises
cin
parents:
diff changeset
30 }