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.
- item #1 emit
- 60 seconds delay
- item #1 emit
- 10 seconds delay
- item #2 emit
- 10 seconds delay and so on
My current code is as follows
.flatMap(dataList -> Observable.fromIterable(dataList)
.zipWith(Observable.interval(10, TimeUnit.SECONDS), (item, interval) -> item)
.doOnNext(data -> {
})