Ejemplo n.º 1
0
        public Promise Start()
        {
            var d = Deferred.Create();
            var t = new Thread(() =>
            {
                try
                {
                    backgroundImpl();
                    d.Resolve();
                }
                catch (Exception ex)
                {
                    d.Reject(ex);
                }
                finally
                {
                    this.Dispose();
                }
            });

            t.IsBackground = true;
            t.Start();
            return(d.Promise);
        }
Ejemplo n.º 2
0
 internal Promise(Deferred deferred)
 {
     this.myDeferred = deferred;
 }