-
Notifications
You must be signed in to change notification settings - Fork 7.6k
2.x: implement ops, add javadoc, remove unused components 8/19-2 #4378
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
Conversation
* | ||
* @return a {@code TestScheduler} meant for debugging | ||
*/ | ||
public static TestScheduler test() { // NOPMD | ||
return new TestScheduler(); |
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.
As an aside, it's weird that this is a factory and all the others are accessors. Is TestScheduler
's constructor public
? If so we should just remove this static method that implies there's somehow a shared scheduler for tests.
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.
This method is traditional
Schedulers.test();
new TestScheduler();
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.
Traditional how? That it's in 1.x? I don't see why that should stop us from removing it.
Doing something like this is wrong:
timer(1, SECONDS, Schedulers.test())
yet it's how you'd use every other static method in this class.
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.
I see. Will you post a PR?
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.
Always!
On Fri, Aug 19, 2016 at 4:41 PM David Karnok [email protected]
wrote:
In src/main/java/io/reactivex/schedulers/Schedulers.java
#4378 (comment):public static Scheduler io() { return RxJavaPlugins.onIoScheduler(IO); }
- public static TestScheduler test() {
- /**
\* Creates and returns a {@code TestScheduler}, which is useful for debugging. It allows you to test
\* schedules of events by manually advancing the clock at whatever pace you choose.
*
\* @return a {@code TestScheduler} meant for debugging
*/
- public static TestScheduler test() { // NOPMD
return new TestScheduler();I see. Will you post a PR?
—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
https://github.com/ReactiveX/RxJava/pull/4378/files/dcdf77a7e2fd6bc836ba63e443424b405321ebcc#r75548361,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEEEe2CE0q5ZDuQa2XTRs0gHCYT_lLNks5qhhUUgaJpZM4JozrR
.
Current coverage is 69.61% (diff: 76.77%)@@ 2.x #4378 diff @@
==========================================
Files 452 450 -2
Lines 32405 32007 -398
Methods 0 0
Messages 0 0
Branches 5129 5108 -21
==========================================
+ Hits 22244 22281 +37
+ Misses 8014 7577 -437
- Partials 2147 2149 +2
|
👍 to code changes. Skimmed the Javadoc for formatting only, not content. |
I'm not worried about javadoc; the community is great at finding errors in there that can be trivially fixed. |
Notable changes:
Observers
andSubscribers
- all their function is available via subscribe() and/or by implementing the abstractXObserver
/XSubscriber
providedSchedulers.immediate()
Single.subscribe(Subscriber)
,Single.subscribe(Observer)
,Completable.subscribe(Subscriber)
andCompletable.subscribe(Observer)
CompletableSerializedObserver
andSingleSerializedObserver
and their parent packageSingle.takeUntil
,Single.flatMapCompletable
Scheduler.schedulePeriodically()
to match 1.xSingle.subscribeOn
disposable managementSubject.hasSubscribers
toSubject.hasObservers