T
- the type of the items emitted by both the source and merged Observable
spublic final class OperatorMerge<T> extends Object implements Observable.Operator<T,Observable<? extends T>>
Observable
s into one Observable
, without any transformation.
You can combine the items emitted by multiple Observable
s so that they act like a single Observable
, by using the merge operation.
The instance(true)
call behaves like OperatorMerge
except that if any of the merged Observables notify of
an error via onError
, mergeDelayError
will refrain from propagating that error
notification until all of the merged Observables have finished emitting items.
Even if multiple merged Observables send onError
notifications, mergeDelayError
will
only invoke the 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 onError
and will effectively swallow errors.
Modifier and Type | Method and Description |
---|---|
Subscriber<Observable<? extends T>> |
call(Subscriber<? super T> child) |
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.
|
public static <T> OperatorMerge<T> instance(boolean delayErrors)
T
- the common value typedelayErrors
- should the merge delay errors?public static <T> OperatorMerge<T> instance(boolean delayErrors, int maxConcurrent)
T
- the value typedelayErrors
- if true, errors are delayed till all sources terminate, if false the first error will
be emitted and all sequences unsubscribedmaxConcurrent
- the maximum number of concurrent subscriptions or Integer.MAX_VALUE for unlimitedpublic Subscriber<Observable<? extends T>> call(Subscriber<? super T> child)
call
in interface Func1<Subscriber<? super T>,Subscriber<? super Observable<? extends T>>>
Copyright © 2017. All rights reserved.