I am trying to add dynamic internal for the list items that have been emitted using RxJava
.
Currently in my flow after every 10 seconds I am emitting the items but what I am trying to achieve is there will be a delay of 60 seconds after emitting first item then rest of the items will continue following 10 seconds of delay.
My current code is as follows
.flatMap(dataList -> Observable.fromIterable(dataList)
.zipWith(Observable.interval(10, TimeUnit.SECONDS), (item, interval) -> item)
.doOnNext(data -> {
})
Use a combination of a just()
and an interval()
with initial delay of 60
.zipWith(
Observable.just(-1L)
.concatWith(Observable.interval(60, 10, TimeUnit.SECONDS)),
(item, interval) -> item
)