2.x: Flowable as a Publisher to be fully RS compliant#5112
Merged
akarnokd merged 1 commit intoReactiveX:2.xfrom Feb 18, 2017
Merged
2.x: Flowable as a Publisher to be fully RS compliant#5112akarnokd merged 1 commit intoReactiveX:2.xfrom
akarnokd merged 1 commit intoReactiveX:2.xfrom
Conversation
Member
Author
|
Okay, let's go from here. In the unlikely case the spec becomes more forgiving, the undo is just to remove cast/wrapping from Flowable.subscribe and everything works the same as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR performs the changes suggested in #5110.
FlowableSubscriberwith extra textual specification on its relaxed natureFlowable.subscribe(Subscriber)checks forFlowableSubscriberand if not found, it wraps the incoming RSSubscriberinto aStrictSubscriberthat follows the RS spec to the letter at any cost.Flowable.subscribe(FlowableSubscribe)that most internal operators will useAbstractFlowableWithUpstreamto acceptFlowableas a source, update operatorsPublisherinput, these were duplicated on their outer containing type but use the same internalFlowableSubscriberdelayimplements Subscriberwithimplements FlowableSubscribernew Subscriberwithnew FlowableSubscriberin tests, the rest is required for testing the strictness itself.strict()is now an identity operator with suggested scheduled removal.Performance impact estimation
Flowableshould go throughsubscribe(FlowableSubscribe)and thus no overhead change.Publisheras input, providing aFlowablewill have aninstanceofcheck at subscription time and routed to `subscribe(FlowableSubscriber) if the consumer is part of RxJava 2 itself.