From: Gustavo Martin Morcuende Date: Sun, 11 Dec 2016 22:38:54 +0000 (+0100) Subject: Removing time out from RxJavaAdapter X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=fd3bd93b2a80e649c5be8ae4090087c583681105;p=JavaForFun Removing time out from RxJavaAdapter IMHO these kinds of time out should be defined by server adminitrators --- diff --git a/SpringJava/RxJava/web-services-spring-rxjava-server/src/main/java/de/spring/webservices/rest/controller/adapters/RxJavaAdapter.java b/SpringJava/RxJava/web-services-spring-rxjava-server/src/main/java/de/spring/webservices/rest/controller/adapters/RxJavaAdapter.java index e7e7537..4191239 100644 --- a/SpringJava/RxJava/web-services-spring-rxjava-server/src/main/java/de/spring/webservices/rest/controller/adapters/RxJavaAdapter.java +++ b/SpringJava/RxJava/web-services-spring-rxjava-server/src/main/java/de/spring/webservices/rest/controller/adapters/RxJavaAdapter.java @@ -20,12 +20,18 @@ public class RxJavaAdapter { // With no value, we depend on the Tomcat/Jboss/Jetty/etc timeout value for asynchronous requests. // Spring will answer after 60 secs with an empty response (by default) and HTTP 503 status (by default) when timeout. - private static final long ASYNC_TIMEOUT = 60000; /* milliseconds */ + // You'd rather better rely on the server values. IMHO this is something to be controlled + // by the server administrator no the developer. + // private static final long ASYNC_TIMEOUT = 60000; /* milliseconds */ + + private RxJavaAdapter() { + + } public static final DeferredResult deferredAdapter(Observable observable) { - DeferredResult deferredResult = new DeferredResult<>(ASYNC_TIMEOUT); + DeferredResult deferredResult = new DeferredResult<>(/** ASYNC_TIMEOUT **/); observable .subscribeOn(Schedulers.io()) @@ -42,7 +48,7 @@ public class RxJavaAdapter { public static final DeferredResult deferredAdapter(Single single) { - DeferredResult deferredResult = new DeferredResult<>(ASYNC_TIMEOUT); + DeferredResult deferredResult = new DeferredResult<>(/** ASYNC_TIMEOUT **/); single .subscribeOn(Schedulers.io())