Skip to content
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

Publish, Replay and Cache Operators #260

Conversation

benjchristensen
Copy link
Member

Added basic Publish (#15) and Replay (#71) operators to Observable. I have not done any of the overloads (particularly Replay which has 10+ in .Net.

I also added a new Cache operator as discussed by @johngmyers and I at #209.

Playing with Replay and ConnectableObservable it does not cater well to the typical use case of needing to just de-dupe calls (cache the responses) so this Cache operator can be thought of as an automatic version of Replay. It comes with the same risk as toList if used with infinite or very large sequences as you can not unsubscribe from it.

Cache operator as discussed in ReactiveX#209

Similar to `replay()` except that this auto-subscribes to the source sequence. This comes with the same cautions as `toList` when dealing with infinite or very large sequences.
@cloudbees-pull-request-builder

RxJava-pull-requests #129 FAILURE
Looks like there's a problem with this pull request

@cloudbees-pull-request-builder

RxJava-pull-requests #130 SUCCESS
This pull request looks good

@benjchristensen
Copy link
Member Author

If anyone has comments on this I'd appreciate them in the next 12 hours otherwise I'll release a new version with these and the last few pull requests I've merged.

@Override
public void run() {
counter.incrementAndGet();
System.out.println("published observable being executed");
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe remove the debug outputs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I could do that ... though I'm glad this is a unit test and not in the actual production code or that would be embarrassing that I left it in :-)

@benjchristensen
Copy link
Member Author

Completed in #263 after merging with other pull requests that caused conflicts.

jihoonson pushed a commit to jihoonson/RxJava that referenced this pull request Mar 6, 2020
…actor-mono-tofuture-success

ReactiveX#245 Fix CircuitBreakerSubscriber for Reactor doesn't count successes…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants