Пример #1
0
        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));
 }
Пример #3
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());
 }
Пример #4
0
 public override IPublisher <int> CreatePublisher(long elements)
 {
     return(Flowable.FromEnumerable(Enumerable.Range(1, (int)elements)));
 }
Пример #5
0
 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));
 }
Пример #6
0
 public static IPublisher <T> Concat <T>(this IEnumerable <ISingle <T> > sources)
 {
     return(Flowable.FromEnumerable(sources).ConcatMap(s => s.ToPublisher()));
 }