From fd3bd93b2a80e649c5be8ae4090087c583681105 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 11 Dec 2016 23:38:54 +0100 Subject: [PATCH] Removing time out from RxJavaAdapter IMHO these kinds of time out should be defined by server adminitrators --- .../webservices/rest/controller/adapters/RxJavaAdapter.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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()) -- 2.1.4