Closed darekdeo closed 7 years ago
No. When you call setInitX you can't access the Schedulers from within because the callback itself executes on the Schedulers' class initialization and other Schedulers fields may not be ready. Use the plain setIoSchedulerHandler
to override and later clear the custom scheduler.
It works, thank you. This was fast.
RxJava version is 2.0.1
Not sure if it's a bug or my lack of knowledge. The issue I have happens when I try to return trampoline scheduler instead of io for my unit tests. An error occurs:
The loadCategories code is as follows, the exception is thrown at .subscribeOn(Schedulers.io()):
Test just calls loadCategories method and mocks few things:
Last but not least, the place where I setInitIoSchedulerHandler is custom TestRunner:
Is it possible to setInitIoSchedulerHandler as above? Full project is available on my git: https://github.com/darekdeo/charades I have currently replaced Schedulers.io with Schedulers.newThread on git, which works fine.