-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Operation throttleLast #365
Conversation
…ationThrottle class.
…xJava into throttle-merge Conflicts: rxjava-core/src/main/java/rx/Observable.java rxjava-core/src/main/java/rx/concurrency/TestScheduler.java
RxJava-pull-requests #258 SUCCESS |
NOTE: This implementation is modified to use As currently implemented this returns the last value of each I'm curious about when the different types of implementations may be more valuable than others. |
Great! Looking forward to having this operator :) |
This will return the last value in each time window. It will always emit at least 1 value in each window. PublishSubject<Integer> o = PublishSubject.create();
o.throttleLast(500, TimeUnit.MILLISECONDS, s).subscribe(observer);
// send events with simulated time increments
s.advanceTimeTo(0, TimeUnit.MILLISECONDS);
o.onNext(1); // skip
o.onNext(2); // deliver
s.advanceTimeTo(501, TimeUnit.MILLISECONDS);
o.onNext(3); // skip
s.advanceTimeTo(600, TimeUnit.MILLISECONDS);
o.onNext(4); // skip
s.advanceTimeTo(700, TimeUnit.MILLISECONDS);
o.onNext(5); // skip
o.onNext(6); // deliver
s.advanceTimeTo(1001, TimeUnit.MILLISECONDS);
o.onNext(7); // deliver
s.advanceTimeTo(1501, TimeUnit.MILLISECONDS);
o.onCompleted(); Compare this with #366 |
Please review this behavior and let me know if it is accurate and if the name is explanatory. |
Javadoc:
|
I have submitted 3 separate pull requests with different variants of
Variants are:
|
Would you summarize for me how this differs from sample()? On Tue, Sep 10, 2013 at 12:17 AM, Ben Christensen
|
The |
Merge of #258