How to use RxJava Interval Operator

后端 未结 3 873
我在风中等你
我在风中等你 2021-01-17 11:33

I\'m learning about RxJava operator, and I found these code below did not print anything:

public static void main(String[] args) {

    Observable
    .inter         


        
3条回答
  •  隐瞒了意图╮
    2021-01-17 11:36

    Put Thread.sleep(1000000) after the subscribe and you will see it working. Observable.interval operates by default on Schedulers.computation() so your stream is being run on a thread other than the main thread.

提交回复
热议问题