60
60
public abstract class Single <T > implements SingleSource <T > {
61
61
62
62
/**
63
- * Runs multiple Single sources and signals the events of the first one that signals (cancelling
63
+ * Runs multiple SingleSources and signals the events of the first one that signals (cancelling
64
64
* the rest).
65
65
* <dl>
66
66
* <dt><b>Scheduler:</b></dt>
@@ -80,7 +80,7 @@ public static <T> Single<T> amb(final Iterable<? extends SingleSource<? extends
80
80
}
81
81
82
82
/**
83
- * Runs multiple Single sources and signals the events of the first one that signals (cancelling
83
+ * Runs multiple SingleSources and signals the events of the first one that signals (cancelling
84
84
* the rest).
85
85
* <dl>
86
86
* <dt><b>Scheduler:</b></dt>
@@ -106,7 +106,7 @@ public static <T> Single<T> ambArray(final SingleSource<? extends T>... sources)
106
106
}
107
107
108
108
/**
109
- * Concatenate the single values, in a non-overlapping fashion, of the Single sources provided by
109
+ * Concatenate the single values, in a non-overlapping fashion, of the SingleSources provided by
110
110
* an Iterable sequence.
111
111
* <dl>
112
112
* <dt><b>Backpressure:</b></dt>
@@ -127,7 +127,7 @@ public static <T> Flowable<T> concat(Iterable<? extends SingleSource<? extends T
127
127
}
128
128
129
129
/**
130
- * Concatenate the single values, in a non-overlapping fashion, of the Single sources provided by
130
+ * Concatenate the single values, in a non-overlapping fashion, of the SingleSources provided by
131
131
* an Observable sequence.
132
132
* <dl>
133
133
* <dt><b>Scheduler:</b></dt>
@@ -147,7 +147,7 @@ public static <T> Observable<T> concat(ObservableSource<? extends SingleSource<?
147
147
}
148
148
149
149
/**
150
- * Concatenate the single values, in a non-overlapping fashion, of the Single sources provided by
150
+ * Concatenate the single values, in a non-overlapping fashion, of the SingleSources provided by
151
151
* a Publisher sequence.
152
152
* <dl>
153
153
* <dt><b>Backpressure:</b></dt>
@@ -169,7 +169,7 @@ public static <T> Flowable<T> concat(Publisher<? extends SingleSource<? extends
169
169
}
170
170
171
171
/**
172
- * Concatenate the single values, in a non-overlapping fashion, of the Single sources provided by
172
+ * Concatenate the single values, in a non-overlapping fashion, of the SingleSources provided by
173
173
* a Publisher sequence and prefetched by the specified amount.
174
174
* <dl>
175
175
* <dt><b>Backpressure:</b></dt>
@@ -299,7 +299,7 @@ public static <T> Flowable<T> concat(
299
299
}
300
300
301
301
/**
302
- * Concatenate the single values, in a non-overlapping fashion, of the Single sources provided in
302
+ * Concatenate the single values, in a non-overlapping fashion, of the SingleSources provided in
303
303
* an array.
304
304
* <dl>
305
305
* <dt><b>Backpressure:</b></dt>
@@ -320,6 +320,80 @@ public static <T> Flowable<T> concatArray(SingleSource<? extends T>... sources)
320
320
return RxJavaPlugins .onAssembly (new FlowableConcatMap (Flowable .fromArray (sources ), SingleInternalHelper .toFlowable (), 2 , ErrorMode .BOUNDARY ));
321
321
}
322
322
323
+ /**
324
+ * Concatenates a sequence of SingleSource eagerly into a single stream of values.
325
+ * <p>
326
+ * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
327
+ * source SingleSources. The operator buffers the value emitted by these SingleSources and then drains them
328
+ * in order, each one after the previous one completes.
329
+ * <dl>
330
+ * <dt><b>Backpressure:</b></dt>
331
+ * <dd>The operator honors backpressure from downstream.</dd>
332
+ * <dt><b>Scheduler:</b></dt>
333
+ * <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
334
+ * </dl>
335
+ * @param <T> the value type
336
+ * @param sources a sequence of Single that need to be eagerly concatenated
337
+ * @return the new Flowable instance with the specified concatenation behavior
338
+ */
339
+ @ SuppressWarnings ({ "rawtypes" , "unchecked" })
340
+ @ BackpressureSupport (BackpressureKind .FULL )
341
+ @ CheckReturnValue
342
+ @ SchedulerSupport (SchedulerSupport .NONE )
343
+ public static <T > Flowable <T > concatArrayEager (SingleSource <? extends T >... sources ) {
344
+ return Flowable .fromArray (sources ).concatMapEager (SingleInternalHelper .<T >toFlowable ());
345
+ }
346
+
347
+ /**
348
+ * Concatenates a Publisher sequence of SingleSources eagerly into a single stream of values.
349
+ * <p>
350
+ * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
351
+ * emitted source Publishers as they are observed. The operator buffers the values emitted by these
352
+ * Publishers and then drains them in order, each one after the previous one completes.
353
+ * <dl>
354
+ * <dt><b>Backpressure:</b></dt>
355
+ * <dd>Backpressure is honored towards the downstream and the outer Publisher is
356
+ * expected to support backpressure. Violating this assumption, the operator will
357
+ * signal {@link io.reactivex.exceptions.MissingBackpressureException}.</dd>
358
+ * <dt><b>Scheduler:</b></dt>
359
+ * <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
360
+ * </dl>
361
+ * @param <T> the value type
362
+ * @param sources a sequence of Publishers that need to be eagerly concatenated
363
+ * @return the new Publisher instance with the specified concatenation behavior
364
+ */
365
+ @ SuppressWarnings ({ "rawtypes" , "unchecked" })
366
+ @ BackpressureSupport (BackpressureKind .FULL )
367
+ @ CheckReturnValue
368
+ @ SchedulerSupport (SchedulerSupport .NONE )
369
+ public static <T > Flowable <T > concatEager (Publisher <? extends SingleSource <? extends T >> sources ) {
370
+ return Flowable .fromPublisher (sources ).concatMapEager (SingleInternalHelper .<T >toFlowable ());
371
+ }
372
+
373
+ /**
374
+ * Concatenates a sequence of SingleSources eagerly into a single stream of values.
375
+ * <p>
376
+ * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
377
+ * source SingleSources. The operator buffers the values emitted by these SingleSources and then drains them
378
+ * in order, each one after the previous one completes.
379
+ * <dl>
380
+ * <dt><b>Backpressure:</b></dt>
381
+ * <dd>Backpressure is honored towards the downstream.</dd>
382
+ * <dt><b>Scheduler:</b></dt>
383
+ * <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
384
+ * </dl>
385
+ * @param <T> the value type
386
+ * @param sources a sequence of SingleSource that need to be eagerly concatenated
387
+ * @return the new Flowable instance with the specified concatenation behavior
388
+ */
389
+ @ SuppressWarnings ({ "rawtypes" , "unchecked" })
390
+ @ BackpressureSupport (BackpressureKind .FULL )
391
+ @ CheckReturnValue
392
+ @ SchedulerSupport (SchedulerSupport .NONE )
393
+ public static <T > Flowable <T > concatEager (Iterable <? extends SingleSource <? extends T >> sources ) {
394
+ return Flowable .fromIterable (sources ).concatMapEager (SingleInternalHelper .<T >toFlowable ());
395
+ }
396
+
323
397
/**
324
398
* Provides an API (via a cold Completable) that bridges the reactive world with the callback-style world.
325
399
* <p>
0 commit comments