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 — Experimental onBackpressureBufferWithCapacity by benjchristensen · Pull Request #1916 · ReactiveX/RxJava

Conversation

@benjchristensen

@benjchristensen benjchristensen commented Dec 2, 2014

Copy link
Copy Markdown
Member

Manual merge of #1899

  • changed Func0 to Action
  • added Beta markers

Sorry, something went wrong.

Uh oh!

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

All reactions
srvaroa and others added 4 commits November 21, 2014 17:05
@srvaroa
Add optional bound to onBackpressureBuffer
af27562
The operator takes an optional capacity for the buffer and a callback to
be triggered when the buffer fills up.
@benjchristensen
Merge branch '1.x' of github.com:srvaroa/RxJava into experimentalOnBa…
c4265fc
…ckpressureBufferWithCapacity
@benjchristensen
Use Action instead of Func0<Void>
40be93b
As per ReactiveX#1899 (comment)
@benjchristensen
Mark onBackpressureBuffer(count) as Beta
5a464e0
benjchristensen
benjchristensen reviewed Dec 2, 2014
View reviewed changes
Comment thread src/main/java/rx/internal/operators/OperatorOnBackpressureBuffer.java Outdated

@benjchristensen benjchristensen Dec 2, 2014

Copy link
Copy Markdown
Member Author

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.

Not sure about the use of this exception. I think it should be MissingBackpressureException like we use elsewhere.

Sorry, something went wrong.

Uh oh!

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

All reactions
@benjchristensen benjchristensen mentioned this pull request Dec 2, 2014
Add optional bound to onBackpressureBuffer #1899
Closed
@benjchristensen
BufferOverflowException -> MissingBackpressureException
656648d
@benjchristensen

benjchristensen commented Dec 2, 2014

Copy link
Copy Markdown
Member Author

Updated to use MissingBackpressureException.

All reactions

Sorry, something went wrong.

Uh oh!

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

@benjchristensen

benjchristensen commented Dec 2, 2014

Copy link
Copy Markdown
Member Author

Should we change Action0 to Action1<T> so that the function receive each item it is dropping so the function can choose to inspect, log or otherwise do something? On one hand it would provide flexibility for anything. On the other it could easily be abused and easily result in blocking IO (even just logging) and kill a system right when backpressure is trying to kick in by dropping data.

All reactions

Sorry, something went wrong.

Uh oh!

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

@benjchristensen benjchristensen mentioned this pull request Dec 2, 2014
Question: Minor vs Patch Increment? #1917
Closed
@benjchristensen

benjchristensen commented Dec 2, 2014

Copy link
Copy Markdown
Member Author

Should we change Action0 to Action1 so that the function receive each item it is dropping

Nevermind. We only call the action onOverflow once, not every item overflowed.

All reactions

Sorry, something went wrong.

Uh oh!

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

@benjchristensen

benjchristensen commented Dec 2, 2014

Copy link
Copy Markdown
Member Author

This seems good enough to include in an @Beta form so am merging to include in 1.0.2. We can iterate further while it's in beta if needed, but it seems okay as is.

All reactions

Sorry, something went wrong.

Uh oh!

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

benjchristensen added a commit that referenced this pull request Dec 2, 2014
@benjchristensen
Merge pull request #1916 from benjchristensen/experimentalOnBackpress…
c8c272e
…ureBufferWithCapacity

Experimental onBackpressureBufferWithCapacity
@benjchristensen
benjchristensen merged commit c8c272e into ReactiveX:1.x Dec 2, 2014
@benjchristensen
benjchristensen deleted the experimentalOnBackpressureBufferWithCapacity branch December 2, 2014 05:59
@benjchristensen
benjchristensen restored the experimentalOnBackpressureBufferWithCapacity branch December 2, 2014 06:19
@benjchristensen benjchristensen mentioned this pull request Dec 2, 2014
Revert "Experimental onBackpressureBufferWithCapacity" #1918
Merged
@srvaroa

srvaroa commented Dec 2, 2014

Copy link
Copy Markdown
Contributor

Hi @benjchristensen

Re. readability of ensureCapacity I agree, thanks for fixing that one + the exception.

Re. Action1 vs. Action0 I'm leaning towards keeping Action0 because the risks seem much clearer than the hypothetical benefits of seeing the dropped item. But I don't have a strong opinion, up to you (we could always add another overload, and warn in the javadoc).

I've been taking a look at the test failures but I can't see a clear cause for the deadlock (which also seem to happen on tests that as far as I can see should not use the code added here). I do reproduce it locally anyway so I'll keep looking into it and submit the fix, hopefully soon.

All reactions

Sorry, something went wrong.

Uh oh!

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

@benjchristensen
benjchristensen deleted the experimentalOnBackpressureBufferWithCapacity branch June 11, 2015 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

2 participants

@benjchristensen @srvaroa
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.