Skip to content

Operator cache() now supports backpressure #2969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2015

Conversation

akarnokd
Copy link
Member

I've removed the controversial features and made the backing CachedObservable internal.

Related issue #1483.

@abersnaze
Copy link
Contributor

Does it really need to be returning a new type of Observable? It seems the methods isConnected(), hasObservers() and cachedEventCount() are only used by the unit tests.

@akarnokd
Copy link
Member Author

Yes. Otherwise one would need ugly reflection magic to get inside the state of this observable.

@abersnaze
Copy link
Contributor

I checked out the branch and took a shot at making it an OnSubscribe function again.
https://github.com/abersnaze/RxJava/tree/OperatorCacheRewrite2

@akarnokd akarnokd force-pushed the OperatorCacheRewrite2 branch from 4219c55 to babbdd8 Compare June 10, 2015 17:23
@akarnokd
Copy link
Member Author

Cache had originally more functionality, i.e., the ability to terminate it manually, like a disconnect, but was downwoted. I forgot about the toCached() methods which are just relics and I'll update this PR.

Otherwise, I don't really see why I shouldn't extend Observable, especially if one day, there will be a real need to support disconnection of cache().

@akarnokd akarnokd force-pushed the OperatorCacheRewrite2 branch from babbdd8 to 18ff5af Compare June 17, 2015 12:05
@akarnokd
Copy link
Member Author

I've rebased it and I'm going to merge this. If there has concern about it being implemented as a Observable, a PR can always be submitted with the suggested changes.

akarnokd added a commit that referenced this pull request Jun 17, 2015
Operator cache() now supports backpressure
@akarnokd akarnokd merged commit f217edd into ReactiveX:1.x Jun 17, 2015
@akarnokd akarnokd deleted the OperatorCacheRewrite2 branch June 17, 2015 12:13
@akarnokd akarnokd restored the OperatorCacheRewrite2 branch July 20, 2015 17:16
@akarnokd akarnokd deleted the OperatorCacheRewrite2 branch September 9, 2015 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants