Esempio n. 1
0
        private Promise<T> _Catch(ChainReturnDelegate Chain)
        {
            lock(lockObject)
            {
                return new Promise<T>((LocalResolve, LocalReject) => {
                    try
                    {
                        _asyncSubject
                            .First()
                            .Where(_ => _isRejected)
                            .Subscribe(_ => {
                                _payload = Chain(_payload);
                                LocalResolve(_payload);
                            });

                        _asyncSubject
                            .First()
                            .Where(_ => _isFulfilled)
                            .Subscribe(_ => {
                                LocalResolve(_payload);
                            });
                    }
                    catch
                    {
                        LocalReject(_payload);
                    }
                });
            }
        }
Esempio n. 2
0
        static IEnumerable <int> Bug_1333_Enumerable(AsyncSubject <IDisposable> s, Semaphore sema)
        {
            var d = s.First();
            var t = new Thread(() => { d.Dispose(); sema.Release(); });

            t.Start();
            t.Join();
            yield return(1);
        }
Esempio n. 3
0
 static IEnumerable<int> Bug_1333_Enumerable(AsyncSubject<IDisposable> s, Semaphore sema)
 {
     var d = s.First();
     var t = new Thread(() => { d.Dispose(); sema.Release(); });
     t.Start();
     t.Join();
     yield return 1;
 }