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: Observable.throttleWithTimeout is confusing #6043

Closed
romanzes opened this issue Jun 14, 2018 · 3 comments
Closed

2.x: Observable.throttleWithTimeout is confusing #6043

romanzes opened this issue Jun 14, 2018 · 3 comments

Comments

@romanzes
Copy link

The documentation for Observable.throttleWithTimeout() implies that it's different from debounce() and invites to read about the differences:

Information on debounce vs throttle:
Debounce and Throttle: visual explanation
Debouncing: javascript methods
Javascript - don't spam your server: debounce and throttle

Of these links, the first one isn't available anymore and the last two are about JS.

Looking at the method's implementation, it becomes clear that in RxJava it's not different from debounce in any way:

@CheckReturnValue
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Observable<T> throttleWithTimeout(long timeout, TimeUnit unit) {
    return debounce(timeout, unit);
}

Do we really need both methods? If yes, could the documentation say explicitly that they are synonyms? Could these links to third-party websites be removed?

@akarnokd
Copy link
Member

Yes, it is an alias so it can be more easily discovered along the throttle methods. debounce is a traditional ReactiveX naming and we kept it for historical reasons.

You can update the javadocs (on both Flowable and Observable if you want. PR welcome.

@akarnokd akarnokd added this to the 2.2 milestone Jun 14, 2018
@romanzes
Copy link
Author

@akarnokd thanks for the clarification. Will open a PR soon :)

@akarnokd
Copy link
Member

Closing via #6049

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants