view Implab/IPromiseT.cs @ 241:c19cee55e85e v2-1

close v2-1 bad idea
author cin
date Thu, 10 Nov 2016 00:31:34 +0300
parents d4e38929ce36
children 2573b562e328
line wrap: on
line source

using System;

namespace Implab {
    public interface IPromise<T> : IPromise {

        new T Join();

        new T Join(int timeout);

        void On(Action<T> success, Action<Exception> error, Action cancel);
        
        void On(Action<T> success, Action<Exception> error);

        void On(Action<T> success);

        IPromise<T2> Then<T2>(Func<T, T2> mapper, Func<Exception,T2> error, Action cancel);

        IPromise<T2> Then<T2>(Func<T, T2> mapper, Func<Exception,T2> error);

        IPromise<T2> Then<T2>(Func<T, T2> mapper);

        IPromise<T2> Chain<T2>(Func<T, IPromise<T2>> chained, Func<Exception,IPromise<T2>> error, Action cancel);

        IPromise<T2> Chain<T2>(Func<T, IPromise<T2>> chained, Func<Exception,IPromise<T2>> error);

        IPromise<T2> Chain<T2>(Func<T, IPromise<T2>> chained);

        IPromise<T> Error(Func<Exception,T> error);

        new IPromise<T> Cancelled(Action handler);

        new IPromise<T> Anyway(Action handler);
    }
}