Skip to content

Commit 8dad2ec

Browse files
committed
Comment explaining non-positive delay values
1 parent 261dc38 commit 8dad2ec

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

rxjava-core/src/main/java/rx/Scheduler.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ public abstract static class Worker implements Subscription {
7171

7272
/**
7373
* Schedules an Action for execution at some point in the future.
74-
*
74+
* <p>Note to implementors: non-positive {@code delayTime} should be regarded as
75+
* undelayed schedule, i.e., as if the {@link #schedule(rx.functions.Action0)} was called.
7576
* @param action
7677
* the Action to schedule
7778
* @param delayTime
78-
* time to wait before executing the action
79+
* time to wait before executing the action, non-positive values indicate an undelayed schedule
7980
* @param unit
8081
* the time unit the delay time is given in
8182
* @return a subscription to be able to unsubscribe the action (unschedule it if not executed)
@@ -86,13 +87,17 @@ public abstract static class Worker implements Subscription {
8687
* Schedules a cancelable action to be executed periodically. This default implementation schedules
8788
* recursively and waits for actions to complete (instead of potentially executing long-running actions
8889
* concurrently). Each scheduler that can do periodic scheduling in a better way should override this.
90+
* <p>Note to implementors: non-positive {@code initialTime} and {@code period} should be regarded as
91+
* undelayed scheduling of the first and any subsequent executions.
8992
*
9093
* @param action
9194
* the Action to execute periodically
9295
* @param initialDelay
93-
* time to wait before executing the action for the first time
96+
* time to wait before executing the action for the first time,
97+
* non-positive values indicate an undelayed schedule
9498
* @param period
95-
* the time interval to wait each time in between executing the action
99+
* the time interval to wait each time in between executing the action,
100+
* non-positive values indicate no delay between repeated schedules
96101
* @param unit
97102
* the time unit the interval above is given in
98103
* @return a subscription to be able to unsubscribe the action (unschedule it if not executed)

0 commit comments

Comments
 (0)