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(); } }
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(); } }