GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 3.x: constrain upstream requests from take, remove limit operator by davidmoten · Pull Request #6650 · ReactiveX/RxJava

Conversation

@davidmoten

@davidmoten davidmoten commented Sep 12, 2019

Copy link
Copy Markdown
Collaborator

As per discussion in #6569, this PR constrains upstream requests from the take operator and removes the limit operator.

I've also added a couple of unit tests for coverage of elementAt that I didn't include in #6620.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@codecov

codecov Bot commented Sep 12, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #6650 into 3.x will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.x    #6650      +/-   ##
============================================
- Coverage     98.11%   98.08%   -0.04%     
+ Complexity     6191     6186       -5     
============================================
  Files           678      677       -1     
  Lines         44722    44674      -48     
  Branches       6176     6166      -10     
============================================
- Hits          43880    43818      -62     
- Misses          294      302       +8     
- Partials        548      554       +6
Impacted Files Coverage Δ Complexity Δ
.../main/java/io/reactivex/rxjava3/core/Flowable.java 100% <ø> (ø) 559 <0> (-2) ⬇️
...ava3/internal/operators/flowable/FlowableTake.java 100% <100%> (ø) 2 <1> (ø) ⬇️
...l/operators/observable/ObservableFlatMapMaybe.java 83.8% <0%> (-4.93%) 2% <0%> (ø)
...al/operators/flowable/FlowableMergeWithSingle.java 97.59% <0%> (-2.41%) 2% <0%> (ø)
...nal/operators/flowable/FlowableMergeWithMaybe.java 97.66% <0%> (-2.34%) 2% <0%> (ø)
...va3/internal/operators/flowable/FlowableRange.java 95.87% <0%> (-2.07%) 3% <0%> (ø)
.../internal/disposables/ListCompositeDisposable.java 98% <0%> (-2%) 34% <0%> (-1%)
...ternal/operators/observable/ObservablePublish.java 97.29% <0%> (-1.81%) 16% <0%> (-1%)
...nal/operators/flowable/FlowableConcatMapEager.java 97.07% <0%> (-1.76%) 2% <0%> (ø)
...ava3/internal/operators/maybe/MaybeMergeArray.java 96.04% <0%> (-1.7%) 6% <0%> (ø)
... and 30 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 852e052...426c817. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@akarnokd akarnokd added 3.x Enhancement labels Sep 12, 2019
@akarnokd akarnokd added this to the 3.0 milestone Sep 12, 2019
akarnokd
akarnokd reviewed Sep 12, 2019
View reviewed changes
Comment thread src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableTake.java Outdated
if (!get() && compareAndSet(false, true)) {
if (n >= limit) {
upstream.request(Long.MAX_VALUE);
while (true) {

@akarnokd akarnokd Sep 12, 2019

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the limit() internals?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/main/java/io/reactivex/rxjava3/core/Flowable.java
* Limits both the number of upstream items (after which the sequence completes)
* and the total downstream request amount requested from the upstream to
* possibly prevent the creation of excess items by the upstream.
* <p>

@akarnokd akarnokd Sep 12, 2019

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Javadoc of take should contain these extra information.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@akarnokd

akarnokd commented Sep 12, 2019

Copy link
Copy Markdown
Member

Why not simply delete take and rename limit? That way, the tests and documentation of limit would remain intact.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@davidmoten

davidmoten commented Sep 12, 2019

Copy link
Copy Markdown
Collaborator Author

Indeed! Will do.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@davidmoten
davidmoten force-pushed the take-constrain-requests branch from c2d9279 to c499746 Compare September 13, 2019 03:13
@davidmoten
3.x: constrain upstream requests from take (ReactiveX#6569)
426c817
@davidmoten
davidmoten force-pushed the take-constrain-requests branch from c499746 to 426c817 Compare September 13, 2019 03:25
@davidmoten

davidmoten commented Sep 13, 2019

Copy link
Copy Markdown
Collaborator Author

Copied code from limit to take and fixed javadoc.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

akarnokd
akarnokd approved these changes Sep 13, 2019
View reviewed changes
vanniktech
vanniktech approved these changes Sep 13, 2019
View reviewed changes
@akarnokd
akarnokd merged commit 0c50f0a into ReactiveX:3.x Sep 13, 2019
@akarnokd akarnokd mentioned this pull request Sep 13, 2019
3.0.0-RC3 release preparations #6649
Closed
@davidmoten
davidmoten deleted the take-constrain-requests branch September 13, 2019 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@akarnokd akarnokd akarnokd approved these changes
+1 more reviewer
@vanniktech vanniktech vanniktech approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

3.x Enhancement

Projects

None yet

Milestone

3.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@davidmoten @akarnokd @vanniktech
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.