Created
August 27, 2015 06:50
-
-
Save patrykpoborca/6ff1650fdd29dfdc2230 to your computer and use it in GitHub Desktop.
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
public class Retrofit { | |
protected OKHttp okHttp; | |
protected final Scheduler mainScheduler; | |
public Retrofit(OKHttp okHttp, Scheduler mainScheduler) { | |
this.okHttp = okHttp; | |
this.mainScheduler = mainScheduler; | |
} | |
public Observable<String> completeRequest(){ | |
return Observable.just(okHttp.rawResponse() + " Some Parsing Done") | |
.delay(2, TimeUnit.SECONDS); | |
} | |
public Observable<String> fetchSomePage(String url){ | |
return Observable.just("<h2>" + "Fake response from fake retrofit: " + url + " </h2>") | |
.delay(2, TimeUnit.SECONDS) | |
.observeOn(mainScheduler); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment