view Implab.Test/PromiseHelper.cs @ 10:aa33d0bb8c0c promises

implemeted new cancellable promises concept
author cin
date Sun, 03 Nov 2013 18:07:38 +0400
parents
children 6ec82bf68c8e
line wrap: on
line source

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

namespace Implab.Test {
    class PromiseHelper {
        public static Promise<T> Sleep<T>(int timeout, T retVal) {
            return AsyncPool.Invoke(() => {
                Thread.Sleep(timeout);
                return retVal;
            });
        }
    }
}