Interface FuseToFlowable<T>
- Type Parameters:
T
- the value type
- All Known Implementing Classes:
FlowableAllSingle
,FlowableAnySingle
,FlowableCollectSingle
,FlowableCollectWithCollectorSingle
,FlowableCountSingle
,FlowableElementAtMaybe
,FlowableElementAtSingle
,FlowableFlatMapCompletableCompletable
,FlowableIgnoreElementsCompletable
,FlowableReduceMaybe
,FlowableSequenceEqualSingle
,FlowableSingleMaybe
,FlowableSingleSingle
,FlowableToListSingle
public interface FuseToFlowable<@NonNull T>
Interface indicating a operator implementation can be macro-fused back to Flowable in case
the operator goes from Flowable to some other reactive type and then the sequence calls
for toFlowable again:
Single<Integer> single = Flowable.range(1, 10).reduce((a, b) -> a + b);
Flowable<Integer> flowable = single.toFlowable();
The Single.toFlowable()
will check for this interface and call the fuseToFlowable()
to return a Flowable which could be the Flowable-specific implementation of reduce(BiFunction).
This causes a slight overhead in assembly time (1 instanceof check, 1 operator allocation and 1 dropped operator) but does not incur the conversion overhead at runtime.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a (direct) Flowable for the operator.
-
Method Details
-
fuseToFlowable
Returns a (direct) Flowable for the operator.The implementation should handle the necessary RxJavaPlugins wrapping.
- Returns:
- the Flowable instance
-