Skip to content

interval sometimes gets stopped when time changed on Android #7872

Closed
@galwaychia

Description

@galwaychia

Observable.interval(
0,
1000,
TimeUnit.MILLISECONDS,
Schedulers.io()
).map {
println("xxxxxxx interval interval interval $it")
}
.sample(
2000,
TimeUnit.MILLISECONDS,
Schedulers.io()
)
.map {
println("xxxxxxx sample sample sample $it")
}.subscribe()


When you change the system time by android setting, the interval maybe stop working. BUT when change the scheduler to Schedulers.computation(), it is gonna be ok.
Looks like interval only works stably on Schedulers.computation().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions