public void FlatMapFromEnumerable() { for (int i = 1; i <= 1000000; i *= 10) { int j = 1000000 / i; Benchmark.Run(() => { Flowable.Range(1, i) .FlatMap(v => Flowable.FromEnumerable(Enumerable.Range(v, j))) .Subscribe(new PerfFlowableSubscriber <int>()); return(null); }, string.Format("FlatMapEnumerable: {0,6:#,##0} x {1,6:#,##0}", i, j)); } }
public override IPublisher <int> CreatePublisher(long elements) { return(Flowable.FromEnumerable(Enumerable.Range(0, (int)elements * 2)).Filter(v => v % 2 == 0)); }
public static ICompletable MergeDelayError(this IEnumerable <ICompletable> sources, int maxConcurrency = int.MaxValue) { return(Flowable.FromEnumerable(sources).FlatMap(c => c.ToPublisher <object>(), true, maxConcurrency).ToCompletable()); }
public override IPublisher <int> CreatePublisher(long elements) { return(Flowable.FromEnumerable(Enumerable.Range(1, (int)elements))); }
public static IPublisher <T> MergeDelayError <T>(this IEnumerable <ISingle <T> > sources, int maxConcurrency = int.MaxValue) { return(Flowable.FromEnumerable(sources).FlatMap(s => s.ToPublisher(), false, maxConcurrency)); }
public static IPublisher <T> Concat <T>(this IEnumerable <ISingle <T> > sources) { return(Flowable.FromEnumerable(sources).ConcatMap(s => s.ToPublisher())); }