Exemple #1
0
        public static IFuture <T> Recover <T>(this IFuture <T> me, Action <System.Exception> recoverFunc)
        {
            InnerFuture inner = me.InnerFuture;

            var ret = inner.Recover((obj) => {
                if (obj is Exception)
                {
                    recoverFunc((Exception)obj);
                }
            }, typeof(Exception));

            return(new FutureWrapper <T>(ret));
        }
Exemple #2
0
        public static IFuture <T> Recover <T, K> (this IFuture <T> me, Action <K> recoverFunc)
        {
            InnerFuture inner = me.InnerFuture;

            var ret = inner.Recover((obj) =>
            {
                if (obj is K)
                {
                    recoverFunc((K)obj);
                }
            }, typeof(K));

            return(new FutureWrapper <T>(ret));
        }