コード例 #1
0
        public void Subscribe(ICompletableObserver observer)
        {
            if (maxConcurrency == int.MaxValue)
            {
                var parent = new MergeAllCoordinator(observer, delayErrors);
                observer.OnSubscribe(parent);
                parent.SubscribeAll(sources);
            }
            else
            {
                var en = default(IEnumerator <ICompletableSource>);
                try
                {
                    en = sources.GetEnumerator();
                }
                catch (Exception ex)
                {
                    DisposableHelper.Error(observer, ex);
                    return;
                }

                var parent = new MergeLimitedCoordinator(observer, en, delayErrors, maxConcurrency);
                observer.OnSubscribe(parent);
                parent.Drain();
            }
        }
コード例 #2
0
 public void Subscribe(ICompletableObserver observer)
 {
     if (maxConcurrency == int.MaxValue)
     {
         var parent = new MergeAllCoordinator(observer, delayErrors);
         observer.OnSubscribe(parent);
         parent.SubscribeAll(sources);
     }
     else
     {
         var parent = new MergeLimitedCoordinator(observer, sources, delayErrors, maxConcurrency);
         observer.OnSubscribe(parent);
         parent.Drain();
     }
 }