Last active
February 4, 2018 17:50
-
-
Save mohsenoid/4291838de3a2060c04ed93d7ada363d1 to your computer and use it in GitHub Desktop.
Sample SchedulerProvider interface https://hackernoon.com/yet-another-mvp-article-part-4-rxjava-and-rxandroid-knows-how-to-response-cde42ccc4958
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mirhoseini.marvel.util; | |
import javax.inject.Inject; | |
import rx.Scheduler; | |
import rx.android.schedulers.AndroidSchedulers; | |
import rx.schedulers.Schedulers; | |
public class AppSchedulerProvider implements SchedulerProvider { | |
@Inject | |
public AppSchedulerProvider() { | |
} | |
@Override | |
public Scheduler mainThread() { | |
return AndroidSchedulers.mainThread(); | |
} | |
@Override | |
public Scheduler backgroundThread() { | |
return Schedulers.io(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mirhoseini.marvel.util; | |
import rx.Scheduler; | |
public interface SchedulerProvider { | |
Scheduler mainThread(); | |
Scheduler backgroundThread(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment