15
15
*/
16
16
package rx .subjects ;
17
17
18
- import java .util .concurrent .TimeUnit ;
19
-
20
18
import rx .Observer ;
21
19
import rx .Scheduler ;
22
20
import rx .functions .Action0 ;
25
23
import rx .schedulers .TestScheduler ;
26
24
import rx .subjects .SubjectSubscriptionManager .SubjectObserver ;
27
25
26
+ import java .util .concurrent .TimeUnit ;
27
+
28
28
/**
29
29
* A variety of Subject that is useful for testing purposes. It operates on a {@link TestScheduler} and allows
30
30
* you to precisely time emissions and notifications to the Subject's subscribers using relative virtual time
@@ -136,11 +136,11 @@ public void call() {
136
136
}
137
137
138
138
/**
139
- * Schedule a call to {@code onNext} at relative time of "now()" on TestScheduler.
139
+ * Schedule a call to {@code onNext} on TestScheduler.
140
140
*/
141
141
@ Override
142
142
public void onNext (T v ) {
143
- onNext (v , innerScheduler . now () );
143
+ onNext (v , 0 );
144
144
}
145
145
146
146
private void _onNext (T v ) {
@@ -154,18 +154,18 @@ private void _onNext(T v) {
154
154
*
155
155
* @param v
156
156
* the item to emit
157
- * @param timeInMilliseconds
157
+ * @param delayTime
158
158
* the number of milliseconds in the future relative to "now()" at which to call {@code onNext}
159
159
*/
160
- public void onNext (final T v , long timeInMilliseconds ) {
160
+ public void onNext (final T v , long delayTime ) {
161
161
innerScheduler .schedule (new Action0 () {
162
162
163
163
@ Override
164
164
public void call () {
165
165
_onNext (v );
166
166
}
167
167
168
- }, timeInMilliseconds , TimeUnit .MILLISECONDS );
168
+ }, delayTime , TimeUnit .MILLISECONDS );
169
169
}
170
170
171
171
@ Override
0 commit comments