com.activeandroid.rxschedulers.RxAndroidSchedulersHook Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of activeandroidrx Show documentation
Show all versions of activeandroidrx Show documentation
ActiveAndroid fork with reactive extensions.
package com.activeandroid.rxschedulers;
import rx.Scheduler;
import rx.functions.Action0;
public class RxAndroidSchedulersHook {
private static final RxAndroidSchedulersHook DEFAULT_INSTANCE = new RxAndroidSchedulersHook();
public static RxAndroidSchedulersHook getDefaultInstance() {
return DEFAULT_INSTANCE;
}
/**
* Scheduler to return from {@link AndroidSchedulers#mainThread()} or {@code null} if default
* should be used.
*
* This instance should be or behave like a stateless singleton.
*/
public Scheduler getMainThreadScheduler() {
return null;
}
/**
* Invoked before the Action is handed over to the scheduler. Can be used for
* wrapping/decorating/logging. The default is just a passthrough.
*
* @param action action to schedule
* @return wrapped action to schedule
*/
public Action0 onSchedule(Action0 action) {
return action;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy