0

I know the delay() and repeat() operator and have read this question.

However, I want the first event to be fired immediately, not wait for X minutes.
It would be weird when user clicks a button and have to wait for X minutes to see the results right?

I want to do something like doSomeTask().nowAndEveryXMinAfter().

doSomeTask:

Observable<Integer> doSomeTask() {
}
ericn
  • 12,476
  • 16
  • 84
  • 127

1 Answers1

3

I think you are looking for the interval operator:

Observable.interval(0, 1, TimeUnit.MINUTES)

Where you can specify the initial delay, and then emit every x minutes. I'm not sure what exactly you want to do, but you can for example concat this after your action if that's an observable.

Alex
  • 2,953
  • 1
  • 27
  • 37