My subscriber's onNext and onComplete functions do not run when I call onNext within my FlowableOnSubscribe class

你。 提交于 2019-11-28 13:49:29

You need to manually issue a request otherwise no data will be emitted when extending Subscriber directly:

@Override
public void onSubscribe(Subscription s) {
    Log.i(TAG, "onSubscribe");
    s.request(Long.MAX_VALUE);
}

Alternatively, you could extend DisposableSubscriber or ResourceSubscriber.

How are you testing it? Is it possible your main thread exits before the Observable has a chance to emit the result because you are using Schedulers.IO for the subscribe thread. Also, your observeOn will not do anything as it is only used for further downstream operators.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!