Skip to content

Add AndroidSchedulers.reset() for better testing support #294

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 5 commits into from
Jun 7, 2016

Conversation

ZacSweers
Copy link
Contributor

@ZacSweers ZacSweers commented Jun 3, 2016

Corresponds to ReactiveX/RxJava#3986

This adds a reset() method to AndroidSchedulers, with the main benefit being improved testing support. This does slightly tweak the internal API of AndroidSchedulers to use a getInstance() approach to allow lazy init. This way we don't have to replace the singleton instance during reset() and allow it to lazily re-evaluate upon next usage. Otherwise, if you change your scheduler hook, you'd always have to make sure you set it before you call Schedulers.reset().

@ZacSweers ZacSweers changed the title Add AndroidSchedulers.reset() for better testing Add AndroidSchedulers.reset() for better testing support Jun 3, 2016
@@ -0,0 +1,42 @@
package rx.android.schedulers;
Copy link
Contributor

Choose a reason for hiding this comment

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

license header

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JakeWharton
Copy link
Contributor

Blocked by ReactiveX/RxJava#3986

@ZacSweers
Copy link
Contributor Author

ReactiveX/RxJava#3986 is in now. Let me know if you'd rather the doc here match that one

@JakeWharton
Copy link
Contributor

It should be whatever is in RxJava

@ZacSweers
Copy link
Contributor Author

Updated the doc

@JakeWharton JakeWharton merged commit c5eaeb3 into ReactiveX:master Jun 7, 2016
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.

2 participants