diff --git a/app/src/main/java/org/ntlab/developrx/JavaMainActivity.java b/app/src/main/java/org/ntlab/developrx/JavaMainActivity.java index 2895bfb..846a7b0 100644 --- a/app/src/main/java/org/ntlab/developrx/JavaMainActivity.java +++ b/app/src/main/java/org/ntlab/developrx/JavaMainActivity.java @@ -7,7 +7,6 @@ import java.util.concurrent.TimeUnit; import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.schedulers.Schedulers; /** * Created by matsumoto_k on 2017/11/11. @@ -62,13 +61,16 @@ addressHttpConnection.addPathParam("api"); addressHttpConnection.addPathParam("search"); addressHttpConnection.addQueryParam("zipcode", "6731102"); - addressHttpConnection.doGet() - .subscribeOn(Schedulers.computation()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe( - response -> System.out.println(response), - error -> error.printStackTrace(), - () -> System.out.println("onComplete")); + addressHttpConnection.doGet(); }); + + addressHttpConnection.getPublishSubject(). + throttleFirst(5000, TimeUnit.MILLISECONDS) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe( + response -> System.out.println(response), + error -> error.printStackTrace(), + () -> System.out.println("onComplete") + ); } }