Skip to content

2.x: Observable.throttleWithTimeout is confusing #6043

@romanzes

Description

@romanzes

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions