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

ThrottleFirstExampleActivity注释写错了 #17

Open
nelson1110 opened this issue Mar 30, 2017 · 1 comment
Open

ThrottleFirstExampleActivity注释写错了 #17

nelson1110 opened this issue Mar 30, 2017 · 1 comment

Comments

@nelson1110
Copy link

private Observable getObservable() {
return Observable.create(new ObservableOnSubscribe() {
@OverRide
public void subscribe(ObservableEmitter emitter) throws Exception {
// send events with simulated time wait
//下面的注释是作者原注释,我觉得不太对,因为这个运行的结果是1,3,7被发送出来了
Thread.sleep(0);
emitter.onNext(1); // skip
emitter.onNext(2); // deliver
Thread.sleep(505);
emitter.onNext(3); // skip
Thread.sleep(99);
emitter.onNext(4); // skip
Thread.sleep(100);
emitter.onNext(5); // skip
emitter.onNext(6); // deliver
Thread.sleep(305);
emitter.onNext(7); // deliver
Thread.sleep(510);
emitter.onComplete();
}
});
}
下面的注释应该是ThrottleLast的结果,和ThrottleFirst的不符

@LuckyTerry
Copy link

的确,是写反了。应该是emit时间周期内的第一个,作者笔误。

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

No branches or pull requests

2 participants