-
- All Implemented Interfaces:
-
com.tds.common.reactor.Observable.Operator
,com.tds.common.reactor.functions.Func1
,com.tds.common.reactor.functions.Function
public final class OperatorMerge<T> implements Observable.Operator<T, Observable<out T>>
Flattens a list of Observables into one
{@code Observable}
, without any transformation.You can combine the items emitted by multiple
{@code Observable}
s so that they act like a single{@code Observable}
, by using the merge operation.The
{@code instance(true)}
call behaves like OperatorMerge except that if any of the merged Observables notify of an error via{@code onError}
,{@code mergeDelayError}
will refrain from propagating that error notification until all of the merged Observables have finished emitting items.Even if multiple merged Observables send
{@code onError}
notifications,{@code mergeDelayError}
will only invoke the{@code onError}
method of its Observers once.This operation allows an Observer to receive all successfully emitted items from all of the source Observables without being interrupted by an error notification from one of them.
Note: If this is used on an Observable that never completes, it will never call
{@code onError}
and will effectively swallow errors.
-
-
Method Summary
Modifier and Type Method Description static <T> OperatorMerge<T>
instance(boolean delayErrors)
static <T> OperatorMerge<T>
instance(boolean delayErrors, int maxConcurrent)
Creates a new instance of the operator with the given delayError and maxConcurrency settings. Subscriber<Observable<out T>>
call(Subscriber<out Object> child)
-
-
Method Detail
-
instance
static <T> OperatorMerge<T> instance(boolean delayErrors)
- Parameters:
delayErrors
- should the merge delay errors?
-
instance
static <T> OperatorMerge<T> instance(boolean delayErrors, int maxConcurrent)
Creates a new instance of the operator with the given delayError and maxConcurrency settings.
- Parameters:
delayErrors
- if true, errors are delayed till all sources terminate, if false the first error willbe emitted and all sequences unsubscribedmaxConcurrent
- the maximum number of concurrent subscriptions or Integer.
-
call
Subscriber<Observable<out T>> call(Subscriber<out Object> child)
-
-
-
-