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

2.x: Expand the JavaDocs of the Scheduler API #5843

Merged
merged 2 commits into from
Feb 13, 2018

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Feb 7, 2018

This PR adds more details to the Scheduler and Worker API, rewords some older sentences and fixes a few mistakes in others.

In addition, the wording of the SchedulerRunnableIntrospection felt a bit clumsy and has been updated as well.

@akarnokd akarnokd added this to the 2.2 milestone Feb 7, 2018
@codecov
Copy link

codecov bot commented Feb 7, 2018

Codecov Report

Merging #5843 into 2.x will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #5843      +/-   ##
============================================
- Coverage     96.38%   96.37%   -0.01%     
- Complexity     5812     5814       +2     
============================================
  Files           634      634              
  Lines         41760    41760              
  Branches       5796     5796              
============================================
- Hits          40251    40248       -3     
+ Misses          591      588       -3     
- Partials        918      924       +6
Impacted Files Coverage Δ Complexity Δ
src/main/java/io/reactivex/Scheduler.java 100% <ø> (ø) 11 <0> (ø) ⬇️
.../operators/flowable/FlowableBlockingSubscribe.java 91.89% <0%> (-5.41%) 9% <0%> (-1%)
...rnal/operators/flowable/FlowableFlatMapSingle.java 91.84% <0%> (-4.9%) 2% <0%> (ø)
...l/operators/observable/ObservableFlatMapMaybe.java 84.96% <0%> (-4.58%) 2% <0%> (ø)
...reactivex/internal/operators/single/SingleAmb.java 96.36% <0%> (-3.64%) 9% <0%> (-1%)
.../internal/operators/flowable/FlowableInterval.java 94.44% <0%> (-2.78%) 3% <0%> (ø)
...nternal/operators/observable/ObservableWindow.java 98% <0%> (-2%) 3% <0%> (ø)
...a/io/reactivex/internal/queue/MpscLinkedQueue.java 98.03% <0%> (-1.97%) 17% <0%> (-1%)
...ternal/operators/observable/ObservablePublish.java 93.85% <0%> (-1.76%) 10% <0%> (ø)
...nternal/operators/observable/ObservableCreate.java 97.43% <0%> (-1.71%) 2% <0%> (ø)
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 363f038...e3b0ee1. Read the comment docs.

Copy link
Contributor

@artem-zinnatullin artem-zinnatullin left a comment

Choose a reason for hiding this comment

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

Looks good, but few picks

* units of work with or without delays or periodically.
* You can get common instances of this class in {@link io.reactivex.schedulers.Schedulers}.
* units of work provided in the form of {@link Runnable}s to be
* executed immediately, after a specified time delay or periodically
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe replace immediately with something like "as soon as possible"?

* the {@link Worker#schedule(Runnable, long, TimeUnit)} for scheduling the {@code Runnable} task periodically.
* The algorithm calculates the next absolute time when the task should run again and schedules this execution
* based on the relative time between it and {@link Worker#now(TimeUnit)}. However, drifts or changes in the
* system clock would affect this calculation either by scheduling subsequent runs too frequently or too far apart.
Copy link
Contributor

Choose a reason for hiding this comment

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

would -> could?

* Schedules a cancelable action to be executed periodically. This default implementation schedules
* recursively and waits for actions to complete (instead of potentially executing long-running actions
* concurrently). Each scheduler that can do periodic scheduling in a better way should override this.
* Schedules a cancelable action to be executed periodically.
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 "cancelable" or add it to other "scheduleXXX" methods?

Other "scheduleXXX" methods also allow cancellation, but their javadoc only mentions it in the description of returned Disposable

@akarnokd akarnokd merged commit 2875fef into ReactiveX:2.x Feb 13, 2018
@akarnokd akarnokd deleted the SchedulerAPIJavaDocFix branch February 13, 2018 07:28
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.

3 participants