view Implab/ResolvedPromise.cs @ 255:b00441e04738 v3

Adde workaround to the behaviour of the logical operations stack in conjuction with async/await methods
author cin
date Wed, 04 Apr 2018 15:38:48 +0300
parents 5cb4826c2c2a
children
line wrap: on
line source

using System;

namespace Implab
{
    public struct ResolvedPromise : IPromise {
        public Type ResultType => typeof(void);

        public bool IsResolved => true;

        public bool IsRejected => false;

        public bool IsFulfilled => true;

        public Exception RejectReason => null;

        public IPromise<T> Cast<T>() {
            throw new InvalidCastException();
        }

        public void Join() {
        }

        public void Join(int timeout) {
        }

        public void Then(IResolvable next) {
            next.Resolve();
        }
    }
}