view Implab/ResolvedPromise.cs @ 278:6691aff01de1 v3

Implab: added XmlDefaultSeializer (SerializersPool is now obsolete) Implab.ServiceHost: rewritten TypeReference (added support for nested types), stable API
author cin
date Thu, 03 May 2018 09:59:44 +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();
        }
    }
}