ConnectableObservable not emitting values

2019-08-22 15:56发布

I am trying to understand hotObservables and have written this example but it doesn't seem to emitting anything.

    ConnectableObservable<Long> cold = Observable.intervalRange(1, 20, 100, 100, TimeUnit.MICROSECONDS).publish();
    cold.subscribe(i -> System.out.println("First: " + i));
    cold.connect();

Moving the cold.connect() to just after creating the ConnectableObservable doesn't changes anything.

0条回答
登录 后发表回答