Skip to content

2.x Single.delay documentation and implementation inconsistent #5382

@mmallozzi

Description

@mmallozzi

The documentation for Single.delay says that success or error signals will be delayed by the specified amount, but in fact errors are not delayed, only successes. I have no opinion on which one should be correct - I ran into it when mocking out the response for an incomplete backend to test a loading/error UI, e.g. Single.error(...).delay(3, TimeUnit.SECONDS), and found that my errors never had a delay. It seems that Observable has both options, with a version of the method that has a boolean flag delayError.

https://github.com/ReactiveX/RxJava/blob/2.x/src/main/java/io/reactivex/Single.java#L1636
https://github.com/ReactiveX/RxJava/blob/2.x/src/main/java/io/reactivex/internal/operators/single/SingleDelay.java#L66

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions