view Implab/IPromiseBase.cs @ 29:768f7deeb55b

Added a casting method for promises.
author cin
date Thu, 06 Mar 2014 17:59:03 +0400
parents f0bf98e4d22c
children b255e4aeef17
line wrap: on
line source

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Implab {
    public interface IPromiseBase: ICancellable {
        /// <summary>
        /// Check whereather the promise has no more than one dependent promise.
        /// </summary>
        bool IsExclusive {
            get;
        }

        /// <summary>
        /// Тип результата, получаемого через данное обещание.
        /// </summary>
        Type PromiseType { get; }

        bool IsResolved { get; }

        bool IsCancelled { get; }

        IPromiseBase Then(Action success,ErrorHandler error);
        IPromiseBase Then(Action success);

        IPromise<T> Cast<T>();

    }
}