Closed
Description
Some operators in Maybe
, Single
and Completable
are delegating to Flowable
operators that may not be the best fit. For example:
public static <T> Flowable<T> merge(@NonNull Publisher<@NonNull ? extends MaybeSource<? extends T>> sources, int maxConcurrency) {
Objects.requireNonNull(sources, "sources is null");
ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency");
return RxJavaPlugins.onAssembly(new FlowableFlatMapPublisher(sources, MaybeToPublisher.instance(), false, maxConcurrency, 1));
}
Can now be:
return RxJavaPlugins.onAssembly(new FlowableFlatMapMaybe<>(sources, Functions.identity(), false, maxConcurrency)
But, since FlowableFlatMapMaybe
takes a Flowable<T>
, not a Publisher<T>
, a new simple class should be created (FlowableFlatMapMaybePublisher
) that takes a Publisher<T>
but reuses the internals of FlowableFlatMapMaybe
.