Skip to content

Javadoc: expand debounce() docs to explain possible interruption #6288

@akarnokd

Description

@akarnokd

debounce schedules a timeout which then emits the last item if no newer item arrives in the meantime. However, if the processing takes too long, a newer item may arrive and the previous task will get disposed, possibly interrupting the long running work.

The Flowable.debounce and Observable.debounce JavaDocs should mention this property for clarity, something along the lines:

<p>
Delivery of the item after the grace period happens on the (default|given) {@code Scheduler}'s 
{@code Worker} which if takes too long, a newer item may arrive from the upstream, causing the 
{@code Worker}'s task to get disposed, which may also interrupt any downstream blocking operation
(yielding an {@code InterruptedException}). It is recommended processing items
that may take long time to be moved to another thread via {@link #observeOn} applied after 
{@code debounce} itself.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions