Skip to content

Instantly share code, notes, and snippets.

@patrykpoborca
Last active August 29, 2015 14:27
Show Gist options
  • Save patrykpoborca/e2c1e665b69125abbbf6 to your computer and use it in GitHub Desktop.
Save patrykpoborca/e2c1e665b69125abbbf6 to your computer and use it in GitHub Desktop.
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