-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Plugins
David Gross edited this page May 29, 2014
·
13 revisions
Plugins allow you to modify the default behavior of RxJava in several respects.
This plugin allows you to override the default computation, i/o, and new thread Schedulers with Schedulers of your choosing. To do this, extend the class RxJavaDefaultSchedulers
and override these methods:
Scheduler getComputationScheduler()
Scheduler getIOScheduler()
Scheduler getNewThreadScheduler()
Then follow these steps:
- Create an object of the new
RxJavaDefaultSchedulers
subclass you have implemented. - Obtain the global
RxJavaPlugins
instance viaRxJavaPlugins.getInstance()
. - Pass your default schedulers object to the
registerDefaultSchedulers()
method of that instance.
When you do this, RxJava will begin to use the Schedulers returned by your methods rather than its built-in defaults.
Copyright (c) 2016-present, RxJava Contributors.
Twitter @RxJava | Gitter @RxJava